SAN FRANCISCO -- When it comes to facing San Francisco Giants closer Sergio Romo, the Colorado Rockies believe they enjoy an advantage over most teams.

Having played one-run games in seven of their previous eight games at AT&T Park, and having lost six of them, the Rockies have seen Romo more than most teams.

That familiarity paid off Friday night when second baseman DJ LeMahieu highlighted a five-run ninth inning against Romo with a tiebreaking RBI single, sending the Rockies to a stunning 7-4 victory in the opener of a three-game series.

"I feel like we've been on the other end of these wins a lot at this ballpark," LeMahieu said after the Rockies' third consecutive win. "No doubt, you see a pitcher enough, you kinda know what to expect."

The Rockies had not had a hit since the third inning before getting four in a six-batter span against Romo (3-2) in the ninth. Romo was seeking his 21st save.

Colorado trailed 4-2 entering the ninth before shortstop Troy Tulowitzki and first baseman Justin Morneau start an uprising with consecutive singles.

After both runners were able to advance a base on catcher Wilin Rosario's long fly to center field, the Giants elected to intentionally walk left fielder Corey Dickerson to load the bases with one out, even though it meant putting the potential go-ahead run at first.

Pinch-hitter Ryan Wheeler then tied the score with a two-run single up the middle.

"It's what I expect to do every night," Wheeler said of pinch hitting. "If I'm not starting, I'm usually going to get just one at-bat and I have to make it count."

Wheeler's hit came with two strikes.

"He had given me a good look down and away," he said. "It (the last pitch) probably wasn't a strike, but I was diving."

LeMahieu followed with his go-ahead hit that scored Dickerson.

The Rockies have now beaten Romo the last two times he has faced them and pounded him for nine total runs in their last three matchups. The Giants closer, who has blown just three saves all season (two against the Rockies), had a win and a save the first two times he saw Colorado this season.

"We hit him pretty good last time," LeMahieu recalled. "I'm happy we were able to do it again."

Right-hander George Kontos relieved Romo after the Giants had lost the lead and was greeted by the Rockies' second pinch-hit of the inning, this one an RBI single by Michael McKenry that scored Wheeler.

The Rockies' fifth run of the inning scored after McKenry had gotten picked off first base. While his teammate was being tagged out in a rundown, LeMahieu raced home to make it 7-4.

"This is a tough place to play," Rockies manager Walt Weiss said. "To win a game like that ... Not only to win the first game of the series, but the way it happened. That's a big win for us."

Right-hander Matt Belisle (1-2), the fourth Colorado pitcher, got the win after pitching a perfect eighth inning. Closer LaTroy Hawkins picked up his 12th save with a 1-2-3 ninth.

Left-hander Jorge De La Rosa started for the Rockies but had to be pulled after three innings in a 2-2 tie because of tightness in his lower back.

Tulowitzki also could not finish the game, leaving for a pinch-runner in the ninth after limping to first base on his inning-opening single. X-rays taken on his right foot afterward were negative.

Giants right-hander Tim Lincecum limited the Rockies to two runs and three hits in six innings. He left with a 3-2 lead, with left fielder Michael Morse having driven in two of the runs with two-out hits.

The RBIs were the 24th and 25th of the season with two outs for Morse, who is the Giants' overall leader in RBIs with 44.

Morse, right fielder Hunter Pence and third baseman Pablo Sandoval had two hits apiece for the Giants, who outhit the Rockies 9-8.

"These are never fun," Giants manager Bruce Bochy said afterward. "We just didn't execute with fundamentals there in the ninth. What could go wrong did go wrong."

Morneau had two hits, including a two-run single, for the Rockies, who were opening a six-game road trip.