MILWAUKEE -- Robbie Ray convinced Diamondbacks manager Torey Lovullo to allow him to finish the fifth inning, and it paid off.
"I bartered with him. I negotiated with him," said Lovullo of Ray before sending the left-hander out in the fifth. "He doesn't let me down very often."
Ray (11-7) had been out since Aug. 14 due to lower back spasms. He allowed three hits, walked four and struck out six on 103 pitches.
"It felt good to get back out there and help the team get a win," Ray said. "I felt like my stuff was good. I felt like I was around the zone all day today. They took some really good at-bats, laid off some really good pitches, but overall I felt like I pitched really well."
Ray has thrown 18 2/3 consecutive scoreless innings against the Brewers.
The win puts the Diamondbacks 4 1/2 games back of the Cubs in the race for the second NL wild-card spot. Chicago lost to Nationals 7-5 Sunday in extra innings. Milwaukee remained two games behind the Cubs.
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.
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.
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.
"We had, what, four at-bats with the tying run at the plate?" Brewers manager Craig Counsell said. "We did a good job battling back and scoring some runs and having some innings where something good was one hit away from happening. We just couldn't finish it."
Archie Bradley picked his seventh save in 10 chances.
Milwaukee star Yasmani Grandal went hitless on his bobblehead day.
Brewers: RHP Jeremy Jeffress was placed on the 10-day IL with a strained left hip. RHP Ray Black was recalled from Triple-A San Antonio. Jeffress said his hip started acting up last week in Washington. He said he's hopeful of a minimum 10-day absence.
Diamondbacks: LHP Alex Young (5-3, 4.04 ERA) will get the ball Monday in San Francisco. Young is 3-1 with a 3.27 ERA in four road starts this season. He's 1-1 with a 5.40 ERA against the Giants.
Brewers: LHP Gio Gonzalez (2-1, 3.64) will take the mound Monday against RHP Adam Wainwright (9-9, 4.51) and the NL Central-leading Cardinals. Gonzalez allowed one earned run on three hits, walked four and struck out six in five innings in a no-decision against St. Louis on Tuesday.
Follow Keith Jenkins on Twitter: https://twitter.com/MrKeithJenkins
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Astros' Justin Verlander, pitching on short rest, chased in 4th inning
The Rays knocked Astros ace Justin Verlander out of Tuesday's Game 4 after just 3⅔ innings as they look to even the ALDS.
Strasburg, Nats aim to complete upset of Dodgers
A winner-take-all scenario that the Washington Nationals hoped for and the Los Angeles Dodgers would have preferred to avoid will occur Wednesday night in Los Angeles: Game 5 of the National League Division Series.
Adam Wainwright available out of bullpen for Cardinals in Game 5
Cardinals manager Mike Shildt said he expects Adam Wainwright to be available out of the bullpen for Game 5 against the Braves.
Twins enter offseason with pride after record year
One bad playoff series against the Yankees can't erase the consistency, resiliency and success displayed by the Twins as they won the AL Central division for the first time since 2010.
Aaron Hicks feels ready to return to New York Yankees' roster after elbow injury
Injured New York Yankees center fielder Aaron Hicks feels like he's ready to return to the roster for the ALCS.
Rays slugger Yandy Diaz not in Game 4 lineup with foot soreness
Yandy Diaz, who blasted two home runs in the Rays' wild card win, was not in their Game 4 lineup against the Astros with foot soreness.