SAN FRANCISCO -- Rockies left-hander Jorge De La Rosa stood ready to correct the assessment that his dominant eight-inning performance against the Giants on Wednesday night was the best of his career.

"That was the best game of my life, not my career," De La Rosa said.

So proud and content was De La Rosa that he didn't worry when the game of his life -- no runs, three hits, nine strikeouts -- nearly slipped into a no-decision, or worse.

But reliever Rafael Betancourt finished a wild ninth by striking out Nate Schierholtz with the tying run at third base, and the Rockies escaped AT&T Park with a 4-3 victory and a 3 1/2-game lead over the Giants in the National League Wild Card race.

"I was just relaxing, watching the ninth, because I believe in those guys," said De La Rosa, who escaped a second-and-third jam in the sixth by striking out Andres Torres, Freddy Sanchez and, to end a nail-biting, eight-pitch at-bat, Pablo Sandoval.

The Giants had dominated the Rockies in winning the first two games of the series and had won six straight vs. Colorado at AT&T Park this season. But now the Rockies have an increased lead with 15 games left (the Giants have 16) and the momentum as they head to meet the D-backs in a three-game set starting Friday night.

"Their crowd tonight was awesome, and they backed them up," said Ian Stewart, who knocked his 24th home run of the season for two runs in the sixth. "But we were able to shut them down, even with a little scare at the end."

The ninth, which started with three Giants hits off left-handed reliever Franklin Morales and an odd miscue on what could easily have been a double play, was a fitting end to a season series between the clubs, which the Giants won, 10-8, that became lively late in the year.

"Why don't we look at an entire season's worth of drama that's taken place between two pretty good ballclubs?" said Rockies manager Jim Tracy, whose team ended its losing streak at four games.

Let's do just that.

The Rockies won three of four at Coors Field in a set that included Ryan Spilborghs' 14th-inning grand slam in a 6-4 victory Aug. 24. The Giants swept at AT&T Park in a series that included Edgar Renteria knocking a grand slam -- off Betancourt -- turning a possible Rockies victory into a 9-5 defeat Aug. 30.

Wednesday's thriller made up for two doleful games in which the Rockies played themselves out of contention early.

While De La Rosa was dominating from the mound, Rockies shortstop Troy Tulowitzki was controlling the rest of the game.

Tulowitzki led off the Rockies' two-run fourth with his team-leading 27th home run of the season, off Matt Cain (13-6), who gave up four runs and five hits in six innings. Clint Barmes added an RBI double later in the inning.

In the bottom of the fourth, Tulowitzki grabbed a Sandoval grounder and started an unusual double play when he caught and tagged an indecisive Torres -- who had doubled -- trying to dive back to second.

"You want to be the guy that gets the big hit, you want to be the guy that makes the good play," said Tulowitzki, who has homered in the last two games and three times on the current road trip.

Stewart's homer made it 4-0 in the sixth. The Giants threatened when Schierholtz walked, pinch-hitter Rich Aurilia singled and both runners advanced when a De La Rosa changeup in the dirt bounced off the heel of catcher Yorvit Torrealba's glove.

De La Rosa and Torrealba used the extent of their tricks to escape. De La Rosa struck out Torres on a changeup, Sanchez on a 1-2 slider, and Sandoval on a 96 mph rising fastball, after mixing that pitch with inside sliders and fastballs.

De La Rosa pumped his fist en route to the dugout after fanning Sandoval, then returned to work in the seventh and eighth. The only baserunner was Juan Uribe, who was hit by a pitch. Uribe stared De La Rosa down and Renteria began a heated conversation with De La Rosa.

It was a challenge for a pitcher whose early career, and even the early part of this season, was dogged by meltdowns after difficult sequences. But this De La Rosa is 15-3 since the start of June. Still, Tracy made a mound trip and offered soothing words.

"My message was simply this: Do not lose your focus. ... You're pitching the game of your life," Tracy said.

In the ninth, Sanchez and Sandoval singled on pitches Morales said were poorly located. Molina singled on a pitch Morales thought was good.

Betancourt, who had one save with the Indians and Wednesday recorded his first since arriving in an August trade, worked Uribe into a grounder to Tulowitzki. Barmes, covering second, expected an underhand toss and never reached Tulowitzki's quick overhand throw. One run scored on an error charged to Tulowitzki.

Betancourt gained sweet revenge by working a popup from Renteria. Randy Winn's grounder drove in a run. Schierholtz somehow held up on two 1-2 fastballs just low and outside, but couldn't hold up on an outside fastball that Tracy termed "unhittable."

"I remember the last time I pitched here, I gave up the grand slam," Betancourt said. "I made Frankie [Morales, who had pitched well before giving way to Betancourt] look bad. I made Jim Tracy look bad.

"I made the whole team look bad, because I gave up the homer. Tonight, I was able to pick up Tulo, Barmie and the whole team."