After the game was delayed at the start by rain, the Pirates scored four unearned runs in the second inning.
The Giants trailed 4-2 going into the sixth but Freddy Sanchez singled with one away against Zach Duke and Uribe hit a homer to center that tied the game.
Buster Posey kept things going with a single and Huff followed with a homer to right.
The rally made a winner out of Jonathan Sanchez (4-4), who gave up five hits and struck out five over 6 1/3 innings.
Pittsburgh's four runs in the second came after a two-out fielding error by Posey at first base.
Duke (3-6) was saddled with the loss after giving up both of the homers in the sixth.
Brian Wilson struck out two in the ninth while recording his 14th save.