Aaron Harang (13-5) limited the Giants to a run on four hits over seven innings and San Francisco failed to capitalize after putting their lead-off batter on base in both the eighth and ninth.
The contest was deadlocked heading into the sixth thanks to solo homers by San Diego's Will Venable in the first and San Francisco's Brett Pill in the fifth.
Cameron Maybin then reached on a two-out double in the sixth and scored when Guzman hit a soft grounder through the hole on the left side off Matt Cain (11-10), who took the loss in his 200th career start. Maybin tripled in the other San Diego run in the eighth.
Aubrey Huff reached on an infield single to start the San Francisco eighth against reliever Chad Qualls, but was promptly thrown out trying to steal second.
Heath Bell came on to work the ninth and allowed a lead-off single to Pablo Sandoval. Cody Ross, however, grounded into a double play and Bell went on to pick up his 36th save.
Wisconsin business offering 'therapeutic cuddling' forced to close
Puzzle-maker slips 'Murdoch Is Evil' into Rupert Murdoch's Sunday Telegraph