Kershaw had been doing his usual outstanding job of late, but had precious little to show for it. He had not won a game in his previous six starts (0-3) despite a 3.38 earned-run average.
Kershaw earned his first victory since May 20 by holding the Giants to four hits in eight-plus innings. He struck out seven.
After the only walk he gave up in the game, Kershaw (6-5) gave up a two-run home run to Buster Posey in the fourth inning. And that was pretty much it for the Giants’ offense.
The Dodgers had taken a lead on a Hanley Ramirez run-scoring single in the third inning before Posey’s 10th home run put the Giants ahead, 2-1.
But the Dodgers broke through against Tim Lincecum with three runs in the sixth inning. Ramirez started it with a one-out single and steal of second base. Andre Ethier singled to drive in Ramirez and tie the score, 2-2.
Ethier then stole his first base this season and scored the go-ahead run when A.J. Ellis doubled to left field. Ellis moved to third base on a Juan Uribe infield hit and scored when Lincecum unleashed a wild pitch.
That was the end for Lincecum, who is 0-5 when matched up against Kershaw. Lincecum was 3-0 in his last four starts against the Dodgers.
The victory raised the last-place Dodgers’ record to 35-42, but pulled them within six games of the Arizona Diamondbacks in the National League West. The Dodgers were 9 1/2 games back at the beginning of their winning streak.
The last time the Dodgers won as many as five games in a row was when they won six straight at the end of last season.
Wednesday marked the Dodgers' first sweep of the Giants since a three-game sweep at AT&T Park in July. It marked the first time they swept the Giants at Dodger Stadium since April 2009.