Aubrey Huff homered twice for the Giants, who have lost seven straight and nine of 10.
The Rockies used a sixth-inning rally to beat two-time Cy Young winner Tim Lincecum (8-4). Ian Stewart led off with a double, went to third on Barmes' fly out to right and scored on Herrera's sacrifice fly to left that made it 4-3.
The Rockies added two more in the eighth. Stewart walked, Barmes singled and Fowler doubled to left-center to drive in Stewart. Herrera followed with a successful squeeze bunt that scored Barmes to make it 6-3.
The Giants took an early lead when Andres Torres led off the game with a double to right. One out later Huff homered into the Rockies' bullpen.
Chacin (5-7) settled down after the rough first inning. He retired 15 of the next 17 batters before running into trouble in the sixth. With two outs Huff hit a solo home run, his 14th of the year, to tie it. Pat Burrell and Pablo Sandoval followed with walks before Chacin retired Juan Uribe on a line drive to deep center to end the threat.
Chacin allowed three runs, walked two and struck out five in outdueling Lincecum. The Giants ace gave up four runs, walked four and struck out four in six innings.
The Rockies got the runs back in the second. Miguel Olivo led off with a double to left and Barmes hit the first pitch he saw from Lincecum into the left-field bleachers to tie it 2-all. It was Barmes' seventh homer of the season.
The Rockies took a 3-2 lead in the fifth when Fowler led off with a triple and scored on Herrera's single to second.
NOTES: It was Huff's second two-homer game this year and 11th of his career. The last time he did it was June 13 against Oakland. ... Rockies 1B Todd Helton (stiff back) and OF Brad Hawpe (bruised ribs) were scratched from the starting lineup. Hawpe pinch hit in the sixth inning and drew a walk. ... Rockies LHP Jorge De La Rosa (torn finger tendon) will make a minor league rehab start Saturday and throw about 100 pitches. De La Rosa, out since April 26, could be reinstated from the 15-day disabled list next week.