Eduardo Escobar added a solo shot for Arizona, which avoided a three-game sweep. It also put an end to the Brewers three-game winning streak.
Robbie Ray fired five shutout innings to earn the win in his return game from the injured list, improving to 11-7 for the Diamondbacks. Archie Bradley got the final four outs for his seventh save.
Manny Pina homered in the seventh and Ryan Braun knocked in the other run in the eighth on a sac-fly for the Brewers. Zach Davies allowed four runs in four innings to take the loss, falling to 8-7 on the season.
The Brewers face a crucial stretch of games starting tonight with the first of a three game series against the St. Louis Cardinals. Gio Gonzalez gets the start for the Brewers and Adam Wainwright goes for St. Louis. The Cardinals have a 2 1/2 game lead on the Chicago Cubs and 4 1/2 games on the Brewers entering play tonight.
The last time the Brewers faced Wainwright was in St. Louis last week. They scored five runs in five innings against him.
The Brewers next 12 games come against St. Louis, Chicago, Houston and again, Chicago.
The schedule gets a little easier in September with 17 of the final 20 games against teams with losing records. But the Brewers will need to play well to finish August to be able to take full advantage of that softer September schedule.