Barry Bonds' pinch-hit, run-scoring single in the eighth broke a tie game and helped San Francisco snap a four-game losing streak.
The Giants entered Wednesday's game trailing San Diego by five games in the NL West and Los Angeles by 4{ games in the wild-card race. They had lost six of their last eight.
The Giants entered the eighth trailing 3-2, but scored five times on six hits off four Colorado pitchers.
Ray Durham's double scored Todd Linden to tie the game and Bonds' single brought home pinch-runner Fred Lewis.
Brian Wilson (2-3) got the win and Manuel Corpas, who hadn't given up a run in his last eight outings, took the loss. Corpas (1-2) gave up three runs without recording an out.
Mike Stanton worked the ninth for his eighth save with the Giants.
© The Canadian Press, 2007