PHOENIX -- When he hit the ball, D-backs first baseman Paul Goldschmidt had a pretty good idea he had just won the game for his team.
"I had a good feeling," Goldschmidt said. "If not [a home run], it wasn't going to be a triple, [because] I wasn't running that hard, so I'm glad it got out of here."
The ball struck the batter's eye in center field, well over the yellow line, as the D-backs walked off with a 3-2 win over the Marlins on Tuesday night at Chase Field.
Former D-backs right-hander Chad Qualls fell behind 1-0 before Goldschmidt turned on his next offering, a 93 mph sinker.
"He missed first pitch with his fastball, and for me, I'm just trying to get a pitch I can hit hard and kind of get it up," said Goldschmidt, who has 17 homers on the season. "He throws a sinker, and it was middle of the plate and up, and I was able to hit it hard and lucky enough to get some backspin and get it out of here."
It was the second homer in as many nights for Goldschmidt, who did not have a hit in Arizona's three-game weekend series against the Padres.
"You know, good hitters figure out a way to get hits," Miami manager Mike Redmond said. "He's put some good at-bats together the last couple nights. Hopefully tomorrow we can go out there and be careful with him. We just made a mistake there, that pitch was middle-in, I think. I know [Qualls] wasn't trying to go there, but that's where it ended up. You just tip your cap, it's a tough loss."
It was Goldschmidt's first career walk-off homer and his second walk-off hit, and the win snapped the first-place D-backs' four-game losing streak.
"We were struggling for a couple of days, and having a big win like this brings that confidence back up," said third baseman Martin Prado, whose fifth homer of the year, a two-run shot in the fourth, tied the game at 2.
Though he didn't figure in the decision, Randall Delgado turned in an impressive performance for the D-backs in his first start of the season.
Called up earlier in the day from Triple-A Reno to take Tyler Skaggs' spot in the rotation, Delgado displayed a devastating changeup, as he scattered eight hits over seven innings with six strikeouts.
"He was keeping the ball down," catcher Miguel Montero said. "He was actually painting those corners. He was incredible, those pitches were right on the corner. Pretty much if he could do that every time he goes out there, he's in the Hall of Fame. Those pitches were Hall of Fame pitches."
No one expects that to happen, but it seems likely that Delgado passed his audition and will get the chance to start on Sunday against the Reds -- though no official announcement has been made.
"I just try to do my job every time they tell me," Delgado said. "I tried to keep it down in the zone and I think it worked, so I'll just try to keep it like that."
Delgado had a brief stint with the D-backs earlier this month and made one appearance out of the bullpen before being sent back to Reno. He wore the same No. 48 jersey this time around, but looked like a different guy in many respects.
"When he came up and threw last time he was not as aggressive as he could be," D-backs manager Kirk Gibson said. "You could see he really kind of shortened up his motion and focused on locating the ball more. He just pounded the zone and hit both sides of the plate with all of his pitches. It should do a lot for his confidence."
Delgado also eased any concerns over his command, as he did not allow a walk.
But the Marlins struck first in the fourth when Delgado struggled to finish off the inning.
With two outs and a runner on first, Derek Dietrich tripled to right-center and Adeiny Hechavarria followed with an RBI single to give Miami a 2-0 lead.
It didn't last long, as the D-backs responded in the bottom half of the inning.
Montero drew a two-out walk off Marlins starter Nathan Eovaldi, and Prado followed with a home run to left to tie the game.
"I was just looking for a fastball and put a good swing on it," Prado said. "He actually tried to come in a little bit and I was ready for a fastball and was able to hit it out."
Steve Gilbert is a reporter for MLB.com. Read his blog, Inside the D-backs, and follow him on Twitter @SteveGilbertMLB. This story was not subject to the approval of Major League Baseball or its clubs.