MILWAUKEE (AP) -- Robbie Ray returned from the injured list and pitched five scoreless innings, Eduardo Escobar and Christian Walker each homered, and the Arizona Diamondbacks beat the Milwaukee Brewers 5-2 Sunday to avoid a series sweep.
Ray (11-7) had been out since Aug. 14 due to lower back spasms. He allowed three hits, walked four and struck out six in five innings. The left-hander has thrown 18 2/3 consecutive scoreless innings against the Brewers.
After scoring one run over the first two games of the series, Arizona scored twice in the first inning. Ketel Marte led off with a single, Tim Locastro reached on a fielder's choice and Walker hit a drive to the left field bleachers. It was Walker's 23rd home run of the season and his fourth of the team's eight hits in the series at that point.
Escobar added on in the fourth with his 29th homer. Walker then reached on a double and came around to score on a fielder's choice to make it 4-0.
That spelled the end for Brewers starter Zach Davies (8-7), who has lost five straight starts.
Milwaukee entered the day two games behind the Cubs for the final NL wild card, and Arizona was 5 1/2 back of Chicago.
Marte scored another run for the Diamondbacks in the fifth on an error by second baseman Keston Hiura. Marte opened the inning with a double off Taylor Williams.
Manny Pina gave Milwaukee its first run in the seventh with his seventh home run. Ryan Braun added another run in the eighth, scoring Hiura on a sacrifice fly. Both runs came off of Yoan Lopez.
Braun, who had a double and a single on the day, has hit safely in each of his last 17 starts.
Christian Yelich had two hits and his 25th stolen base. The reigning NL MVP stepped to the plate with two on in the bottom of the ninth but grounded out for the final out.
Archie Bradley picked up the save for the Diamondbacks. It was his seventh in 10 chances.
Milwaukee star Yasmani Grandal went hitless on his bobblehead day.