They were the most homers ever hit by the Giants at Petco Park, where the spacious outfield normally gobbles up fly balls.
"You certainly don't expect it in this park," said Huff, who started the barrage with a 408-foot shot off Jon Garland into the sand play area beyond the fence in right-center. "When I hit mine, I mean that's as good as I can hit a curveball to right-center. I hit it and I knew I got a lot of it, then I realized where I was and I started running hard."
Matt Cain took a three-hitter into the ninth.
"We've had some bad times against these guys, so winning the first one is big for us," Cain said.
It was the Giants' third win in 12 games against San Diego this season. The Giants have two more losses than the Padres, who have played two fewer games than San Francisco.
Huff and Freddy Sanchez each had three hits for the Giants, who trail Atlanta by one game in the wild-card race.
Cain (11-10) allowed David Eckstein's leadoff single in the ninth followed by Ryan Ludwick's homer to straightaway center, leading manager Bruce Bochy to turn to Javier Lopez and Ramon Ramirez to finish. Cain struck out eight and walked one.
San Francisco has won eight of 11 while the Padres have lost 11 of 14. It was the 13th straight game in which the Padres were held to four or fewer runs.
Garland (13-11) took his third straight loss. His previous two defeats were during a 10-game Padres losing streak that trimmed 5½ games off their lead.
The Giants hit Garland early, often and hard. He allowed three of the Giants' homers and Kevin Correia surrendered the fourth.
"Terrible, terrible, especially to start a series," Garland said. "I guarantee you no person in San Diego feels worse than I do and I get to go home and sleep on it. It's going to be a fun night.
"Everything was up," Garland said. "Big hits, a couple of home runs, it's pretty simple. They knocked the ball around the yard. I didn't give the team a chance."
Andres Torres led off the game with a triple to right-center and scored on Sanchez's single to left.
Sanchez was aboard on a one-out single for Huff's 24th homer in the third.
Uribe also homered into the sand, on a 3-1 pitch with two outs in the fourth, for a 4-1 lead. It was his 20th.
With Huff on after a two-out double in the fifth, Posey drove a 1-0 pitch into the second deck in left for his 12th homer.
Garland was booed as he walked off the field after getting Jose Guillen to ground out. He allowed six runs and eight hits in five innings.
The Padres turned three double plays behind Garland.
"I think they kept the beating down to a minimum," he said.
Correia started the sixth and gave up Burrell's towering, 421-foot shot off the facade of the Western Metal Supply Co. brick warehouse in the left-field corner. It was his 15th.
"You don't see some of the balls hit where they hit them," Padres manager Bud Black said.
"It got contagious," Giants manager Bruce Bochy said.
Bochy, who was forced out as San Diego's manager following the 2006 season, said it's not quite time to consider these do-or-die games.
But, he added: "It's great to get off to a good start here, especially in this ballpark where we've had our struggles. I think that was important for us to come out and play well against a club we've had a tough time against."
Ludwick's homer was his fourth with San Diego and 15th overall. Cain also allowed Will Venable's homer leading off the third, his 12th.Notes
- The four homers tied the Giants' season high, as well as tying the Padres' season high for homers allowed.
- The Giants have won nine of Cain's starts since the All-Star break.
- Correia made his first relief appearance with the Padres after 59 starts. His last relief appearance was Sept. 24, 2008, with San Francisco.
- Correia had been scheduled to start Tuesday but was pushed back when illness pushed back ace Mat Latos from Monday to Tuesday.
- Friday night's pitching matchup is San Francisco's Jonathan Sanchez versus San Diego's Clayton Richard.