Adrian Gonzalez hit a two-run homer to put the Dodgers ahead in the eighth inning, and NL West-leading Los Angeles beat the last-place Milwaukee Brewers 4-3 on Sunday.
The Dodgers took two out of three from the Brewers to go into the All-Star break with a 51-39 record.
Pedro Baez (2-1) got the victory with a strikeout in one inning of relief. Kenley Jansen pitched the ninth to earn his 16th save in 17 chances, including his last nine since June 12.
Howie Kendrick singled leading off the eighth on his 32nd birthday and advanced to second after center fielder Carlos Gomez misplayed the ball for an error. Gonzalez followed with his 18th homer on an 0-2 pitch from Will Smith (4-1), giving the Dodgers a 4-3 lead.