SAN FRANCISCO -- Michael Cuddyer couldn't remember ever putting a ball in play against Sergio Romo.
That is, until Tuesday night.
Cuddyer worked the count and hit a tiebreaking home run leading off the ninth inning to go with his three-run shot in the fifth, and the Colorado Rockies rallied from an early six-run deficit to beat the San Francisco Giants 9-8.
"I don't usually sniff Romo," said Cuddyer, who raised his average to .330 as he chases the NL batting crown.
Cuddyer sent a full-count pitch from Romo into the left-center seats for his 20th home run of the season, 10th career multihomer game and second this year. He also connected in Colorado's five-run fifth to spark the comeback.
The Rockies snapped a four-game losing streak with their second victory in eight games.
"It's a character-building win for us," said Cuddyer, who had been 0 for 4 with three strikeouts against Romo. "There's a few things: One, we can win in this place, and we can win in this place when we're down. Down by six is a considerable amount early. It's easy to kind of go through the motions the rest of the way, and we didn't do that."
Hunter Pence produced some impressive slugging himself, hitting a three-run homer in the first, an RBI double in the fourth and a tying, two-run single in the eighth against winner Wilton Lopez (3-4).
Pence matched his career high with six RBI. He also drove in six runs on Aug. 12, 2009, at Florida with Houston.
Romo (4-7) gave up Cuddyer's go-ahead home run, though much of the sellout crowd of 41,171 was already long gone by the late innings. The game ended at 11:17 p.m. after 4 hours, 2 minutes.
Rex Brothers finished for his 16th save in 18 chances to end the longest nine-inning game of the season for each club.
"Neither team wanted to relinquish that game," Cuddyer said. "It was fun to see."
Rockies starter Jorge De La Rosa left early as a precaution with left thumb soreness as well as tender index and middle fingers. He was denied a chance to move into a share of the NL lead for wins with Washington's Jordan Zimmermann, who beat the Mets earlier in the evening.
"Yesterday when I was playing catch, I felt more pain than normal," he said. "Today when I was warming up it bothered me. That's not an excuse not to make good pitches."
De La Rosa's day was done after only two innings for his shortest outing since going 1 2/3 innings on July 31, 2008, at Florida. Next time out, he will try again to match the franchise mark for victories in a season by a left-hander set by teammate Jeff Francis in 2007.
Pence's 20th home run was a high drive to left that hit the foul pole and ricocheted into the stands. He has six straight 20-homer seasons.
"Yesterday I felt great and didn't get any hits," he said. "I felt terrible before the game and told (third base coach Tim) Flannery maybe I'm due for some hits. It worked out."
Ryan Vogelsong has one victory in seven outings since returning Aug. 9 from a broken bone in his pitching hand that sidelined him for 2½ months. He failed to strike out a batter for the third time in 108 career starts -- and first time since Sept. 29, 2004, at Philadelphia with the Pirates.
De La Rosa, whose 10 victories following a loss by his team lead the majors, was tagged for four runs and four hits. He remains one victory from a career high and had his six-start winning streak end with a no-decision. He hasn't lost in seven outings since Aug. 3 at Pittsburgh.
It was the Rockies' turn to rally a night after losing in 10 innings.
D.J. LeMahieu had an RBI single in the fifth for the Rockies to extend his career-best hitting streak to 12 games, and Corey Dickerson also singled in a run that inning ahead of Cuddyer's homer.
Roy Oswalt will start Saturday at Arizona as the Rockies give the 36-year-old righty a chance to earn a job beyond this year.
"We think he's a piece going forward," manager Walt Weiss said. "We want to get a good look at Roy down the stretch. We feel good about who he is and his impact on our club in the clubhouse, the way he mentors younger guys."
Giants manager Bruce Bochy greeted Rockies 1B Todd Helton near the batting cage before the game and wished him "good luck" ahead of his expected retirement. "I've always appreciated how he plays the game," Bochy said. ... San Francisco LHP Jeremy Affeldt, out since July 21 with a strained left groin, is scheduled to be activated from the DL on Wednesday. RHP Chad Gaudin, meanwhile, will likely face hitters once more Thursday in Los Angeles before returning from carpal tunnel syndrome. ... Rockies OF Carlos Gonzalez will get another opinion on the sprained joint in his right middle finger when the team goes to Arizona later this week. He said the specialists he has seen already believe he won't need surgery but rather extended rest during the offseason. Gonzalez returned from the DL on Sept. 3 but hasn't had a plate appearance. He said it's "very possible" he won't start or hit in another game this season because "it can get worse on any swing." ... RHP Yusmeiro Petit (3-0) pitches Wednesday afternoon's series finale for the Giants after coming within one out of a perfect game Friday night against Arizona.