PHOENIX -- Center fielder Tony Campana had been waiting seven weeks for this hit and his entire career for this situation.

Campana rolled a singled into center field with two outs in the ninth inning to drive in Martin Prado from third base and give the Arizona Diamondbacks a 4-3 victory over Milwaukee at Chase Field on Wednesday.

It was Campana's first hit since April 24 and the first walk-off hit of his four-year career.

"Martin was at third, so I knew all I had to do was put a ball in play and beat it to first," Campana said. "Just get a ball on the ground -- and (I) snuck it through."

Third baseman Prado doubled with one out in the ninth inning off right-hander Brandon Kintzler (1-3) and took third on a groundout by left fielder David Peralta to bring up Campana.

Campana made the Diamondbacks' Opening Day roster but was sent to Triple-A Reno on May 1 after going into a 1-for-30 slump. He was recalled on Friday, when outfielder Ender Inciarte was put on the seven-day concussion disabled list.

"If I'm here, I'm happy," Campana said. "Any time I'm in the lineup, I want to do what I can to help the team win. Today I was able to get one big hit."

Right-hander Brad Ziegler (3-1) retired all four batters he faced, striking out third baseman Aramis Ramirez on a slow breaking pitch with runners on first and second and two outs in the eighth inning. Ramirez had homered in the Brewers' 7-5 victory Tuesday.

"He's been a great fastball hitter his whole career," Ziegler said, "so you just have to pitch cautiously, especially with runners in scoring position, because he is going to be ultra-aggressive.

"I had a pretty good feel for my offspeed stuff, so I decided to stick with it."

Shortstop Chris Owings had three hits and an RBI for the Diamondbacks (31-44), who had lost six of their last seven.

First baseman Paul Goldschmidt singled, drove in a run and scored for Arizona.

Khris Davis' three-run home run in the fourth inning off left-hander Wade Miley accounted for the Brewers' scoring.

Milwaukee (43-30) had won five of its last seven. The Brewers lead the major leagues with 23 road victories and are 7-4 on the road in a stretch in which they play 15 of 18 away from home.

"We didn't do a lot offensively," Milwaukee manager Ron Roenicke said. "We just had the one inning with Davis hitting a three-run homer. Besides that we didn't swing the bats very well."

Miley gave up three runs on five hits and four walks in 7 2/3 innings. He struck out eight. Miley has won only one of his last 13 starts, although he has made seven quality starts in that span.

Milwaukee right-hander Matt Garza gave up three runs (two earned) on seven hits in 7 2/3 innings while making his 10th quality start of the season. He struck out four and did not walk a batter.

"He (Garza) gave us a chance to win, but we have to be able to score more runs," Milwaukee catcher Jonathan Lucroy said. "He gave us a chance win, but we have to hit. That is the bottom line."

Arizona opened up a 3-0 lead by the third inning.

Right fielder Gerardo Parra tripled into the right-field corner to lead off the first inning and scored on Owings' infield single. Goldschmidt reached on a fielder's choice and scored after a throwing error by second baseman Rickie Weeks, a wild pitch and a groundout.

"There were ground balls and ground balls, that's it," Garza said. "Some fluke plays and that's all there was."

Owings tripled to center field to open the third and scored on Goldschmidt's single for a 3-0 lead.

Lucroy and Carlos Gomez singled to open the fourth inning before Davis' 12th homer of the season tied the game at 3-3.

NOTES: Milwaukee CF Carlos Gomez was back in the lineup after missing the first two games of the series with a left hamstring injury. "I don't want to say he's 100 percent, but he's good," Milwaukee manager Ron Roenicke said. "He definitely wanted to play today." Gomez extended his hitting streak to 14 games with a fourth-inning single. ... Arizona CF A.J. Pollock was tied for the NL lead with six outfield assists despite missing the last 2 1/2 weeks with a fractured metacarpal on right hand. The Diamondbacks are tied with the Mets for the NL lead with 20 outfield assists.