Los Angeles won its second in a row despite committing three errors and being outhit 11-9.
Milwaukee had moved in front 4-3 on an RBI single from Norichika Aoki in the top of the seventh, but the Dodgers struck back in the bottom half of the inning to go in front for good.
Los Angeles put runners on first and second with two away in the seventh and Gonzalez brought both of them home with a double to center off reliever Mike Gonzalez (0-2).
Ronald Belisario (2-2), the fourth of five Los Angeles pitchers, got the win with 1 2/3 innings that included three strikeouts. Brandon League gave up a run in the ninth, but still collected his seventh save.