Sosa, Alou and Aramis Ramirez all connected as Chicago won its third straight game. Sosa's two-run blast off San Diego starter Adam Eaton (1-4) snapped a 2-2 tie in the fifth inning and moved him past Mike Schmidt into ninth place on the all-time list.
Sosa's homer traveled 434 feet -- the longest homer in the brief history of the new PETCO Park in San Diego.
Three batters later, Ramirez belted his ninth of the season -- a three-run shot that gave Chicago a 7-2 advantage. Alou's ninth homer was a solo shot in the third inning that made it 2-0.
Chicago starter Sergio Mitre (2-2) allowed three runs and six hits in six innings.
The Padres pulled within 7-5 on Sean Burroughs's RBI double off Kyle Farnsworth with two outs in the eighth inning. LaTroy Hawkins entered and retired Mark Loretta to close the inning before striking out a pair in a perfect ninth for his third save.