Wily Peralta (2-1) went six innings for the Brewers, allowing three runs on six hits and a walk.
The Dodgers took a 3-2 lead into the seventh, when Matt Guerrier (1-1) surrendered Gomez's home run to put the Brewers ahead 4-3. Guerrier was still on the mound in the eight, when Maldonado drove in Rickie Weeks with his first home run of the season.
Dodgers starter Matt Magill went 6 2/3 innings, giving up two runs on four hits with two walks and seven strikeouts.
Andre Ethier cracked a solo shot for Los Angeles, which had won four of its last five contests coming in.
Milwaukee had lost two straight following a nine-game winning streak.