Updated

Carlos Gonzalez hit a tying triple with no outs in the ninth and scored on second baseman Freddy Sanchez's second throwing error of the game, and the Colorado Rockies rallied to beat the San Francisco Giants 2-1 on Monday night.

The Giants squandered a key chance to gain ground on the first-place San Diego Padres in the NL West and the Phillies in the wild-card race after both those teams lost. Instead, San Francisco still sits five games back in the division and 1½ games behind Philadelphia.

Giants starter Jonathan Sanchez carried a shutout bid into the ninth then gave way to All-Star closer Brian Wilson (3-2) after a leadoff walk to Dexter Fowler. Gonzalez then tripled over the head of right fielder Cody Ross and Freddy Sanchez's relay throw skipped past third baseman Pablo Sandoval and Wilson.

Rafael Betancourt (5-1) pitched the eighth for the win, then Huston Street finished for his 13th save in 17 chances.

Despite getting back-to-back quality outings from Matt Cain and then Sanchez, Giants starters are just 5-13 over their last 27 games. The once-reliable bullpen blew Cain's three-run lead in the seventh inning Sunday against Arizona, then Wilson couldn't hold it for Jonathan Sanchez.

Buster Posey put San Francisco ahead on an RBI single in the fourth. Posey returned to the lineup after missing two games to rest a mild strain in his left forearm sustained Friday night against Arizona.

Jonathan Sanchez left to a rousing standing ovation. His performance had come at an ideal time as the September stretch run nears with 19 straight games against division opponents. The Giants beat last-place Arizona 9-7 on Sunday to avoid what would have been an embarrassing sweep at home.

San Francisco was in the hunt until mid-September last year but wound up missing the playoffs for a sixth consecutive year.

Jorge De La Rosa struck out nine to match his season high and avoided losing to the Giants for the first time in 11 career outings, including seven starts. He is 6-0 — 3-0 at AT&T Park — with the six wins his most against any opponent. De La Rosa hung tough with Sanchez, allowing one run on four hits in seven strong innings.

The Rockies, fresh off a 5-1 homestand, couldn't capitalize on the Giants grounding into double plays in the second, fourth and sixth innings. They did when it mattered.

Freddy Sanchez also committed an error in the first inning — his third in four games after not having one all year before this stretch. The throwing error allowed Eric Young Jr. to go from first to second following a leadoff single. Young was then caught stealing, the Giants' first in the last 16 attempts by opponents.

Colorado's Clint Barmes came off the bereavement list and was in the lineup at shortstop in place of Troy Tulowitzki, sidelined for what could be a few days with a sore left groin. Tulowitzki extended his hitting streak to 10 games Sunday.

Notes: The Rockies are tweaking their rotation for Thursday and Friday: Jhoulys Chacin will go in Thursday's makeup game with the Phillies at Coors Field and Aaron Cook on Friday in San Diego. ... Rockies pitchers Jeff Francis and Matt Daley, both on the DL, are set to throw simulated games Tuesday. ... Injured Giants INF Mark DeRosa (wrist surgery) hopes to begin swinging sometime this month and be ready to return if the Giants make the playoffs, but him playing again in 2010 is still highly unlikely. "The Gods are not for him this year," manager Bruce Bochy said. ... The Rockies placed 3B Ian Stewart on the 15-day DL with a strained right oblique he hurt in the batting cage during Friday's loss to the Los Angeles Dodgers. The move is retroactive to Thursday. He didn't respond to anti-inflammatories in recent days and manager Jim Tracy said the club didn't want to risk further damage. Melvin Mora started in Stewart's place.