Updated

Arizona tries to make it two straight wins on Wednesday when the Diamondbacks play the rubber match of a three-game series versus the Miami Marlins at Chase Field.

Arizona put the brakes on a four-game losing streak in dramatic fashion Tuesday, as Paul Goldschmidt's game-winning homer in the ninth inning lifted the Diamondbacks to a 3-2 win.

With the game tied 2-2, Goldschmidt smacked Chad Qualls' (2-1) second-pitch sinker over the wall in center field.

"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."

David Hernandez (3-4) earned the win after tossing a perfect top of the ninth inning. Randall Delgado gave up two runs on eight hits while striking out six over seven innings in his first start of the season for the D'backs, who won for only the second time in their last seven tries.

"It's a tough loss," Marlins manager Mike Redmond said. "All you can do is just tip your cap."

Hoping to deliver the NL West division leaders a series win on Wednesday will be righty Trevor Cahill, who is 3-8 with a 3.96 ERA. Cahill lost his third straight start and fourth consecutive decision on Friday in San Diego, despite a decent effort that saw him allow two runs and five hits with 10 strikeouts in 5 2/3 innings.

"Right from the get-go he was pretty darn good," said bench coach Alan Trammel, who acted as Arizona's manager while Kirk Gibson served a one-game suspension. "You can't fault anyone for one inning or a few hitters. It goes back to the offense that scored one run."

Cahill beat Miami earlier in the year, holding it to a run and five hits in eight innings.

Miami, meanwhile, will counter with righty Jose Fernandez, who has won his last two decisions. Fernandez beat the St. Louis Cardinals on Friday, as he held them to three runs (2 earned) and six hits in seven innings. He also fanned a career-best 10 batters to improve to 4-3 to go along with a 3.11 ERA.

The right-hander's ERA ranks third among rookie starters, and he's also second in strikeouts (77) and opponents' batting average (.210).

"He's so polished for a young pitcher," Redmond said. "It's amazing how good his secondary pitches are."

Arizona took two of three from the Marlins earlier in the season.