DENVER -- Barry Bonds withstood the pain and played on what should have been a day off. Moises Alou hustled out a pair of triples on his aching, 39-year-old legs.
Those gutsy efforts helped the San Francisco Giants get the only thing they were looking for when they came to Denver for the weekend -- a chance at the playoffs as they head into the final week of the season.
"It's going to be tough," Giants first baseman J.T. Snow said. "Can we do it? Yeah, we can do it. We need to play our best baseball and get some luck and get some things to go our way. You never know. Crazy things have happened."
Pinch-hitter Julio Ramirez hit the go-ahead single -- his first major-league hit since 2002 -- off Rockies closer Brian Fuentes (2-5) in the ninth, as San Francisco pulled within 4½ games of San Diego in the NL West.
The Padres played at Arizona later Sunday. The Giants and Padres start a four-game series in San Diego on Monday and the win by the Giants (73-82) means they'll be mathematically alive in the West until at least Tuesday.
"We won't have to look at the scoreboard anymore, and we will have a good series, have some fun and play good baseball," Alou said of the upcoming games against the Padres.
Alou, who has been less than 100 percent much of this season with leg problems, had a single to go with the first multi-triple game of his 15-year career. He scored after the first triple for a 2-0 lead in the second. The second triple scored two runs in the ninth to make it 5-2 and chase Fuentes.
"I woke up a little sore today in my calf and I told my dad, `If you can give me a break every once in a while, that would be good,"' Alou said of the conversation with Giants manager Felipe Alou. "I must have known that I was going to get on base today."
Still running gingerly on his surgically repaired knee, Bonds normally wouldn't start in a day game following a night game. But, given San Francisco's dire playoff circumstances, Felipe Alou asked the slugger if he could go and Bonds said yes.
He finished 0-for-3 with a walk, failing to get the ball out of the infield, before being lifted for a defensive replacement in the seventh.
He popped out to short and second -- the second popout with two runners on -- and drew a walk against Rockies starter Byung-Hyun Kim. With a runner on first in the seventh, Bonds faced lefty reliever Randy Williams and grounded out to first.
Bonds left Coors Field -- where his 24 homers are the most of any visiting player -- still stuck on 707 career homers, seven behind Babe Ruth for second on the all-time list. He finished with two singles, two walks and an RBI in the three-game series.
"You'd think if you handled him, your chances of winning are better," said Rockies manager Clint Hurdle, whose team lost two of three to the Giants. "We were able to handle him. We weren't able to handle some of the other guys."
Felipe Alou knows what a difference it makes having Bonds in the lineup.
"I talked him into playing today more than anything," Alou said. "We got him four at-bats as opposed to a pinch hit."
The manager said the slugger would be able to play and start as long as the Giants are in the race. Once they're done, though, Bonds probably is, too - at least as a starter.
Tyler Walker (5-4) pitched the eighth to get the win. Closer Armando Benitez worked the ninth for the Giants in a non-save situation.
Randy Winn had three hits for San Francisco, including his third leadoff homer of the season.
Todd Helton homered in the fourth for Colorado to extend his hitting streak to 12 games.
Kim, competing for a spot in Colorado's 2006 rotation, allowed two runs and six hits in five innings.
Giants starter Matt Cain went six innings, allowing one run and three hits before being replaced by LaTroy Hawkins, who walked the leadoff hitter in the seventh and allowed the game-tying run on an RBI triple by pinch-hitter Aaron Miles.
With the loss, the Rockies finished their home schedule at 40-41. They play their last two series at Atlanta and the Mets. ... The Giants improved to 10-10-1 in their 21 series since the All-Star break. ... With a closing-day crowd of 31,746, the Rockies drew 1,914,389 this season, the lowest total in the 13-year history of the franchise.