Updated

Hunter Pence's RBI single in the sixth inning was the difference as the San Francisco Giants edged the Colorado Rockies, 2-1, in the opener of a four-game series.

Madison Bumgarner (15-10) allowed the one run on four hits and five walks with six strikeouts over six innings to record his first win in five starts for the NL West-leading Giants, who won for the fifth time in six games.

"It feels better to win a game like that than it does to go out there when you're really sharp and throwing good," Bumgarner said. "It feels good to know that you don't have your best stuff and you can still fight your way through and give us a chance."

Guillermo Moscoso (3-2) allowed the deciding run to take the loss after Jhoulys Chacin surrendered one run on five hits and a walk in a five-inning start for Colorado, which dropped its third straight.

After Colorado left runners in scoring position in each of the first, second and third innings, the Giants broke through in the bottom of the third when Brandon Crawford hit a leadoff triple and later scored on a passed ball by catcher Wilin Rosario.

San Francisco failed to add to its lead by stranding a man on third in the fourth inning before the Rockies were able to tie the game in the fifth, as Chacin hit a double to right field and came home on Josh Rutledge's two-out triple.

The Giants had a chance to regain the lead in the home fifth after Crawford led off the frame with a ground-rule double to right-center field, but he was thrown out at home while trying to score on Angel Pagan's base hit to left field.

However, San Francisco was able to go back on top in the sixth inning with three straight singles by Pablo Sandoval, Buster Posey and Pence.

Guillermo Mota, Jose Mijares and Santiago Casilla then combined to pitch a scoreless seventh inning before Casilla worked a perfect eighth and retired the first batter of the ninth.

Javier Lopez entered next and retired pinch-hitter Carlos Gonzalez on a grounder to short, and Sergio Romo fanned pinch-hitter Jason Giambi to earn his 12th save of the season.

"To think that you're going to go out, especially against this pitching staff, and throw seven, eight or nine runs up, it's not going to happen," Rockies manager Jim Tracy said about the Giants. "You got to do what you have to do to get the points you need to win, and then play the game the way you have to play it in order to not afford them unnecessary opportunities."

Game Notes

Bumgarner had allowed at least four earned runs in his previous four starts. He improved to 5-3 in 11 career appearances against the Rockies ... Colorado hit 1-for-8 with runners in scoring position and left six men on base ... The Giants went 2-for-10 with runners in scoring position and stranded eight.