Greinke (5-0), who went 15-0 in 23 games at Miller Park as a member of the Brewers from 2011-12, gave up just an unearned run on two hits with six strikeouts.
Greinke joined Mets ace Matt Harvey as the lone pitchers in the National League with five wins.
Matt Garza (2-4) took a shutout into the sixth inning before serving up a three-run homer to Justin Turner that ultimately decided the game. Jimmy Rollins and Gonzalez hit two-run homers in the seventh inning against Neal Cotts to put the game away.
Garza was charged with three runs on four hits over six innings for the Brewers, who fell to 1-1 under new manager Craig Counsell.
Milwaukee opened the scoring when Jean Segura, who missed Monday's series opener after getting hit in the helmet with a pitch on Sunday, reached on an error with two outs in the second inning. Aramis Ramirez scored from first on Joc Pederson's misplay in center field.
Garza was cruising until Howie Kendrick's one-out single in the top of the sixth led to his downfall. Gonzalez drew a walk which set up Turner's shot to straightaway center.
Greinke doubled with one away in the seventh inning, jumpstarting another Dodgers rally. Two batters later, Rollins smacked his third homer of the season to left to make it 5-1. Kendrick then walked and Gonzalez followed suit with his team-leading ninth long ball.
Both teams added a run in the ninth, with Turner capping his strong night with an RBI single and Ramirez ripping an RBI double to left in the home half.