PHOENIX -- Paul Goldschmidt entered the Miami series in the worst skid of his stellar season, but it might be hard to convince the Marlins.
The Arizona first baseman hit a walk-off home run leading off the ninth inning Tuesday, giving the Diamondbacks a 3-2 victory over Marlins at Chase Field.
Goldschmidt homered for the second time in as many games after enduring a 4-for-39 funk.
"Obviously the results weren't there, but I was hitting some balls hard and having pretty good at-bats," Goldschmidt said. "You try not to get too frustrated and stick with the approach that has worked, and try to keep having good at-bats."
Goldschmidt hit a 1-0 pitch from Chad Qualls off the batter's eye in center field for his 17th home of the year. He has 62 RBIs, second in the majors to Detroit's Miguel Cabrera.
"Any way you can win. Walkoff. Blowout. Come from behind. Guys are just playing hard 'til the end trying to win games," Goldschmidt said.
The D-backs (38-33) broke a season-long four-game losing streak with their major league-high 16th one-run victory. It was the 15th victory in their last at-bat, and Goldschmidt's second walkoff hit this season. His ninth-inning single beat the Los Angeles Dodgers on April 14.
"He has put some good at-bats together the last couple of nights. Hopefully tomorrow we can go out there and be a little more careful with him," Miami manager Mike Redmond said.
Miami (22-48) had won three of its last four and six of its last nine games.
David Hernandez (3-1) pitched a 1-2-3 ninth inning for the victory.
Arizona third baseman Martin Prado hit his fifth home run of the season, his first since April 29.
The Marlins had eight hits, but none after rookie shortstop Adeiny Hechavarria doubled into the left-field corner to open the seventh inning and was thrown out by Jason Kubel attempting to stretch it into a triple. Kubel has four assists this season after leading NL outfielders with 14 last year.
Hechavarria and Logan Morrison had two hits for the Marlins, and they figured in a two-run fourth-inning rally of Arizona starter Randall Delgado, who was making his first start of the season.
Morrison singled with one out in the fourth before Derek Dietrich tripled to right-center to make it 1-0. Hechavarria singled to right field for a 2-0 lead. Dietrich, who made his major-league debut May 8, has reached in 30 of his 34 games.
Miami starter Nathan Eovaldi, also making his first start of the season after suffering shoulder tightness late in spring training, gave up a two-run homer to Prado after walking Miguel Montero with two outs in the last of the fourth.
"It felt good getting back on the mound. The fastball felt good," Eovaldi said. "In that fourth inning, especially after we just scored two runs and got the lead, it is really big to get three quick outs. End up walking Montero with two outs, and then after that my timing was a little bit off."
Miami left fielder Juan Pierre extended his hitting streak to 14 games with a single in the third inning. He has 10 hitting streaks of at least 14 games, tied for third among active players with Michael Young behind Ichiro Suzuki (19) and Derek Jeter (17).
NOTES: The Diamondbacks signed first-round draft choice RHP Braden Shipley to a $2.25 million bonus Tuesday, and he is to report to Class A Hillsboro. Shipley, the 15th player taken in the draft, was 7-3 with a 2.77 ERA at the University of Nevada this season. ... With two home runs Monday, Giancarlo Stanton joined Bob Horner and Eddie Mathews as the only players to start their major league careers before their 21st birthday and have 100 homers in their first 400 games, according to Elias. Stanton hit both levels Monday, and is the ninth fastest to 100 homers in major league history by games played. Ryan Howard did it the quickest, in 325 games. ... The Marlins optioned LHP Edgar Olmos to Double-A Jacksonville to make room for Eovaldi. ... The D-backs optioned RHP Charles Brewer to Triple-A Reno to make room for Delgado, who could be in line for more starts with RHP Ian Kennedy serving his 10-game suspension and RHP Brandon McCarthy (shoulder) on the disabled list.