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.
"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 1/2 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.
"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
Top offseason spenders might include Angels, Padres, White Sox
Keith Law and Jeff Passan predict the teams that will be the biggest buyers this offseason.
Will Francisco Lindor and Kris Bryant be traded?
Keith Law and Jeff Passan predict whether the Indians and Cubs will make moves this offseason involving stars Francisco Lindor and Kris Bryant.
Will Dodgers spend for top-notch free agent this offseason?
Jeff Passan and Keith Law discuss the possible moves the Dodgers might make after another disappointing postseason.
What will the Red Sox do with Mookie Betts?
Jeff Passan and Keith Law discuss the tough dilemma facing the Red Sox this offseason: Will they keep Mookie Betts or trade him for more pitching?
Yankees, Cubs face crucial offseason decisions
Keith Law and Jeff Passan explain why the pressure is on the Yankees and Cubs this offseason to improve their rosters.
Mike Trout, Braves trio among 2019 Silver Slugger award winners
Angels outfielder Mike Trout has received his seventh Silver Slugger Award after batting .291 with 45 home runs and 104 RBIs this season.