Huff's sixth-inning shot off Jeremy Guthrie (3-8) cleared the right field stands of AT&T Park and landed in McCovey Cove, while Uribe followed up with a homer to left to help boost the Giants to a win in the rubber match of their three-game set with the Orioles.
Huff ended the day 3-for-4 with two RBI and a pair of runs scored. Uribe also doubled to highlight San Francisco's fifth victory in six games.
Tim Lincecum (7-2) struck out 10 batters in six innings, yielding two runs on eight hits and four walks. The two-time Cy Young Award winner tossed his second straight strong game after a string of poor outings.
Brian Wilson collected his 18th save after hurling 1 2/3 innings of scoreless relief.
Julio Lugo went 3-for-5 with a pair of RBI in Baltimore's loss.