Anderson, meanwhile, had his best outing of the spring, giving up just one unearned run over three innings as he battles to secure a spot in Milwaukee's rotation.
Nick Ahmed, who is competing with Chris Owings and Ketel Marte to be the D-backs' starting shortstop, had a big day at the plate, driving home a pair of runs -- one on a double and the other on a triple.
Kirk Nieuwenhuis led the Brewers' offense with a home run off Brian Matusz in the fifth.
Oswaldo Arcia hit his second homer of the spring for the D-backs in the fourth.