PHOENIX -- A bullpen blowup put the Arizona Diamondbacks in a tough spot Tuesday night.
A next-day bounce back keeps their slim NL wild-card hopes alive.
Mike Leake worked effectively through traffic into the seventh inning, Domingo Leyba had two RBIs and the Diamondbacks rebounded from an ugly loss to beat the Miami Marlins 5-4 on Wednesday.
"After a really tough night last night where you're kind of ground down, the guys came out today, quick turnaround, and executed the game plan and won a baseball game," Arizona manager Torey Lovullo said, referencing Tuesday's 12-6 loss to Miami.
Arizona is 4 ½ games behind the Cubs and Brewers in the race for the NL's second wild-card spot.
The Diamondbacks responded by jumping on Sandy Alcantara (5-14) early to keep their slim playoff chances alive with nine games to go.
Abraham Almonte hit his first career leadoff home run and Christian Walker added a solo shot for Arizona.
Leake (12-11) gave up solo homers to Austin Dean and Starlin Castro, but limited the rest of the damage in 6 2/3 innings. Archie Bradley retired the final four batters for his 15th save.
"Pretty good game in general. Back and forth," Marlins manager Don Mattingly said. "We didn't get enough big hits to get over the hump today."
The Marlins (53-99) are one defeat from the third 100-loss season in team history, the first since 2012.
Leake allowed four earned runs in 26 innings over previous four starts, but the Marlins hit him hard early.
Marlin hit his 20th homer in the second inning and Harold Ramirez followed with a run-scoring single. Dean hit a solo homer in the fourth.
Leake gave up three runs on eight hits and struck out four.
"The home runs are kind of chance pitches that are not quite getting where they're supposed to," Leake said.
Alcantara allowed one run over seven innings his last start, against San Francisco. He wasn't nearly as effective against the Diamondbacks, who scored four runs off the right-hander in the first three innings.
Alcantara left a 1-2 pitch up and over the plate in the first inning to Almonte, who sent it into the pool deck in right-center.
Leyba hit run-scoring triple and scored on Jerrod Dyson's single in the second inning, then drove in another run in the fourth on a groundout. Walker's 26th homer put Arizona up 5-3 in the sixth.
Alcantara allowed five runs — four earned — on seven hits in 5 2/3 innings.
"I want to go as deep as I can. Sometimes that doesn't happen," Alacantara said. "Don't want to have a bad day, but today was not a bad day. I want to finish strong. I have two starts left. Working hard to get better every time."
Arizona catcher Alex Avila was called for catcher's interference on a swing by Ramirez in the eighth inning, prompting a visit to the umpire by Lovullo.
The reason? Avila thought the ball was already in his glove when Ramirez made contact. Under baseball rules, catcher's interference can't be called if the catcher already has the ball in his glove.
Lovullo talked over the bang-bang play with plate umpire Brian Knight and the umpires gathered, but ultimately decided Ramirez struck Avila's glove just before he caught it.
"I just wanted them to get together because Al felt strongly it was in his glove," Lovullo said. "The umpires thought it was approaching. I haven't seen the play, but was told the umpires got it right."
Marlins: C Jorge Alfaro was back in the lineup after being hit on his non-throwing hand by a bat and leaving Tuesday's game in the second inning.
Diamondbacks: CF Ketel Marte was out of the lineup and had a precautionary MRI after leaving Tuesday's game in the fifth inning with back stiffness. He is expected to get a CT scan next and his status for the upcoming series at San Diego is still up in the air. ... SS Nick Ahmed was out for the second straight due to an injured finger on his throwing hand suffered in Monday's game.
Marlins: RHP Robert Duggar has allowed two runs or less in five straight starts heading into Friday's game at home against Washington.
Diamondbacks: RHP Merrill Kelly is 2-1 with a 1.35 ERA in three starts heading into Friday's game at San Diego.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP—Sports