Mike Leake worked effectively through traffic into the seventh inning, Domingo Leyba had two RBIs and the Arizona Diamondbacks beat the Miami Marlins 5-4 on Wednesday.

Arizona had dropped to 5 ½ games back in the NL wild-card race after a bullpen blowup led to a 12-6 loss to Miami Tuesday night.

The Diamondbacks bounced back by jumping on Sandy Alcantara (5-14) early to keep their slim playoff chances alive with nine games to go.

Miami Marlins' Austin Dean crosses the plate after hitting a solo home run during the fourth inning of a baseball game abasing the Arizona Diamondbacks, Wednesday, Sept. 18, 2019, in Phoenix. (AP PhotoMatt York)

Miami Marlins' Austin Dean crosses the plate after hitting a solo home run during the fourth inning of a baseball game abasing the Arizona Diamondbacks, Wednesday, Sept. 18, 2019, in Phoenix. (AP PhotoMatt York)

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.

Leake allowed four earned runs in 26 innings over previous four starts, but the Marlins hit him hard early.

Miami Marlins starting pitcher Sandy Alcantara throws against the Arizona Diamondbacks during the first inning of a baseball game, Wednesday, Sept. 18, 2019, in Phoenix. (AP PhotoMatt York)

Miami Marlins starting pitcher Sandy Alcantara throws against the Arizona Diamondbacks during the first inning of a baseball game, Wednesday, Sept. 18, 2019, in Phoenix. (AP PhotoMatt York)

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.

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.

TRAINER'S ROOM

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. ... SS Nick Ahmed was out for the second straight due to an injured finger on his throwing hand suffered in Monday's game.

UP NEXT

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