Guzman's shot came after Tommy Medica had supplied a run-scoring single to ignite the four-run outburst, which put the Padres ahead to stay at 5-3.
Jed Gyorko also launched a two-run homer and Chris Denorfia added a solo shot for San Diego, which evened its season-ending, three-game series.
Eric Stults (11-13) yielded three runs on seven hits over seven innings to notch the win. He didn't issue a walk and struck out three.
Giants starter Yusmeiro Petit (4-1) was lit up for five runs on seven hits in a 3 2/3-inning effort.
Hunter Pence, newly signed to a five-year contract, smacked his 27th homer of the year for San Francisco.