Gallardo (3-4) pitched into the eighth inning for the first time this season, striking out five and giving up five hits while throwing 108 pitches.
Francisco Rodriguez replaced Gallardo in the eighth and worked his way out of a bases-loaded jam.
Arizona's only run came on Jason Kubel's homer in the fourth.
Four of the Milwaukee runs came off Ian Kennedy (3-5), who lasted 5 2/3 innings while giving up seven hits and striking out seven.
Video of Victoria’s Secret models trying to 'twerk' hits Instagram
Ohio crash that killed two caught on camera [VIDEO]