It was evident early on Friday night that starting pitcher Madison Bumgarner wasn't as sharp as usual. It was going to be one of those nights where he needed to find a way to grind it out.

Bumgarner did just that as he relied more upon his hitting prowess -- blasting a go-ahead fourth-inning grand slam and knocking in five runs -- than his pitching acumen in the Giants' 6-5 victory over the Colorado Rockies at AT&T Park.

"That's quite a night, five RBI," Giants manager Bruce Bochy said. "He wasn't quite as sharp (on the mound) but he found a way to win the game, and he did it with the bat tonight."

The Giants snapped a two-game losing streak with a win in the first of three games against the Rockies and before a sold-out crowd. In the process, the Giants remained tied with the Dodgers atop the National League West.

Sergio Romo closed out the game by striking out the three batters he faced for his third save. He also showed no lingering effects from the cramps he experienced Thursday as a result of the flu.

Bumgarner struggled from the outset Friday, but he persevered and made enough quality pitches when he needed to most.

The Rockies got their leadoff batter on base in four of the first five innings and managed seven hits and two walks during that span. But Bumgarner limited the damage and prevented the Rockies from building an insurmountable lead.

The Giants finally erupted in the fourth with an improbable two-out rally. Brandon Hicks got hit by a pitch to load the bases and Brandon Crawford walked to force in a run, cutting the deficit to 3-2 and bringing Bumgarner to the plate.

Bumgarner plated the Giants first run with a fly ball to left that Carlos Gonzalez caught with his back against the wall in the third inning. Bumgarner left no doubt in his next at-bat, with his prodigious blast landing about halfway up the bleachers in left and fans showering Bumgarner with cheers and screams as he rounded the bases.

Just like that, with one mighty swing Bumgarner turned a one-run deficit into a three-run cushion.

"They don't really expect a whole lot out of pitchers, so we get to go up there with no pressure," Bumgarner said. "It's easier to hit that way but, at the same time, it's the hardest thing to do in sports."

Bumgarner picked an ideal game to show off his batting skills, in part because of his shakiness on the mound but also because Bochy gave leadoff hitter Angel Pagan and cleanup hitter Buster Posey the night off.

Someone needed to pick up the slack. Bumgarner wasn't waiting around. Have bat, will do damage.

Those who watch batting practice on a regular basis know Bumgarner has plenty of power and isn't out of his comfort zone in the batter's box.

Far more people have come to know Bumgarner as the Giants ace and one of the game's most consistent pitchers. But even he isn't immune from off nights.

The Rockies scored a run on three hits and a walk in the first, then upped the lead to 3-0 in the third on a Gonzalez line shot, two run home run into McCovey Cove.