Updated

PHOENIX -- Ryan Braun homered, Jimmy Nelson threw seven innings in one of his best starts of the season to win a pitching duel with Arizona's Patrick Corbin, and the Milwaukee Brewers beat the Diamondbacks 2-1 on Friday night.

Nelson (8-9) allowed five hits and escaped a couple of early jams to improve his record to 5-1 over his last six starts. He struck out five and walked three, one intentionally.

Corbin (1-3) went seven innings in his fifth and longest outing since his return in early June from Tommy John surgery. The lefty allowed one run, matched his career high with 10 strikeouts, walked one and hit a batter. He blanked the Brewers on three hits before Braun homered on the first pitch of the sixth inning.

Milwaukee's second run scored on Brad Ziegler's two-out wild pitch in the ninth.

Chris Owings led off the Arizona ninth with a triple and scored on Nick Ahmed's one-out sacrifice fly to center. Pinch-hitter Welington Castillo grounded sharply to shortstop for the final out to give Francisco Rodriguez his 22nd save in as many tries.

Jonathan Lucroy had three hits for Milwaukee in its fifth victory in the last seven games. Arizona has dropped nine of 11 and is 2-6 with two games left in a 10-game homestand.

The Diamondbacks wasted two early chances.

Ender Inciarte opened the first with a double and Paul Goldschmidt drew a one-out walk. A wild pitch moved the runners to second and third with one out but Nelson struck out David Peralta and Owings to end the threat.

An intentional walk to Goldschmidt loaded the bases for Arizona with one out in the third, and Peralta promptly bounced an inning-ending double-play ball to the pitcher.

Corbin allowed only one runner to reach second -- Hernan Perez's two-out double in the second -- before Braun hit the first pitch of the second inning into the seats in right field, his 18th home run of the season.

Inciarte led off the eighth with a single but was wiped out by the Brewers' third double play of the game.

Goldschmidt's two walks gave him a major league-high 77. His 21 intentional walks are by far the most in the majors.

TRAINER'S ROOM

Brewers: RHP Willy Peralta (strained right oblique) is continuing his rehab with Double-A Biloxi. He was placed on the DL on May 25, retroactive to May 23.

Diamondbacks: Castillo missed his third straight start with a sore hamstring. Manager Chip Hale says he expects Castillo back in the lineup on Saturday.

UP NEXT

Brewers: RHP Taylor Jungmann (5-1, 2.04 ERA) takes the mound in the series finale, his ninth start since being called up from Triple-A Colorado Springs. Jungmann has a 1.29 ERA in his last five starts.

Diamondbacks: Arizona looks to rebound at home with Rubby De La Rosa (7-5, 4.83) on the mound.