Sanchez (11-8) allowed two runs on four hits with no walks over seven innings for the Giants, who have won nine of their last 12 games and climbed into first place in the NL West a half game ahead of San Diego. The Padres fell to the St. Louis Cardinals 4-0 Thursday.
Sanchez has won three straight, during a span in which he has allowed just one earned run over 27 innings.
Dodgers starter Ted Lilly (8-11) gave up a three-run home run to Huff in the third inning and then served up a long ball to Buster Posey. Guillen -- who finished with three hits -- smacked a two-run homer off of Jeff Weaver in the fifth inning.
Freedy Sanchez had three RBI and Edgar Renteria had four hits for the Giants.
Lilly allowed six runs on seven hits.
Russ Mitchell hit his first major league homer for the Dodgers, who lost for the ninth time in their last 12 games.