PHOENIX -- Gerardo Parra drove in three runs and scored another, Paul Goldschmidt scored three times and the D-backs staged a late rally, but were edged, 9-8 in an extra-inning loss to the Brewers at Maryvale Baseball Park on Friday.

Arizona led, 6-2, after five innings but trailed, 7-6, after seven before the D-backs got back-to-back home runs from Tuffy Gosewisch and Rudy Flores in the eighth off Brewers right-hander Hiram Burgos to reclaim the lead. The Brewers tied the game in the bottom of the ninth on Sean Halton's RBI double.

Parra delivered a two-run single in the first inning and a sacrifice fly in the third before working a walk from Brewers reliever Michael Blazek amid Arizona's three-run fifth. Goldschmidt finished 2-for-3 with a walk and three runs scored. Pollock and Martin Prado had two hits apiece.

For Milwaukee, Brewers catcher Jonathan Lucroy hit a two-run home run in the first inning and utility man Elian Herrera also delivered two RBIs. The Brewers' brief lead came on a single by Minor Leaguer Brandon Macias.

D-backs starter Randall Delgado surrendered a two-run home run to Lucroy in the first inning, one of three Brewers hits in the frame. But Delgado was otherwise effective, allowing only those two runs on five total hits in four innings, with no walks and three strikeouts.

Brewers starter Wily Peralta was charged with three earned runs on six hits in 4 2/3 innings, with no walks and three strikeouts.

Up next: Left-hander Patrick Corbin will make his last Cactus League start before he pitches in the Opening Series in Australia, taking on the Indians at Goodyear Ballpark in a 1:05 p.m. MST start Saturday. Corbin, who won 14 games in a breakout 2013 campaign, has gone 0-1 with a 4.85 ERA through his first three exhibition starts this spring, covering 13 innings of work. Corbin is the D-backs' scheduled starter for the season opener in Sydney. The D-backs will head to Australia after Sunday's game.