The Giants scored twice in the first inning and then turned things over to Gaudin (4-1), who gave up three hits, walked no one and struck out eight in seven innings.
San Francisco sent four pitchers to the mound in the eighth to work out of a bases-loaded jam and Sergio Romo struck out one while retiring the side in order in the ninth for his 22nd save.
Those runs were charged to Ian Kennedy (3-7), who gave up five hits in seven innings.
Pistorius testifies he didn't consciously pull trigger when he shot girlfriend
Pregnant Mila Kunis wins 'Best Villain' at MTV Movie Awards