Gallardo (12-7) allowed four hits, walked three and fanned six. He was 0-2 over his previous five appearances and won for the first time since August 8 against Houston.
Gallardo doubled to lead off the fifth inning and scored on Ryan Braun's two- out double. Milwaukee's other run came on Casey McGehee's 21st homer of the season.
Casey Coleman (1-2) was charged with five hits and a run over six innings pitched for the Cubs, who blanked the Brewers on Friday and Saturday.