PHOENIX - Jake Lamb has spent a big chunk of this season injured and even when healthy, his .199 batting average entering Monday was proof of a year gone awry.
But in a big moment for the Diamondbacks, he came through.
"It's no secret how I've been playing," Lamb said. "But I feel like I've done a pretty good job of coming to the yard every day, trying to get better and I just work, work, work.
"It's nice to come through in that situation. I've always loved hitting in those situations."
Clinging to slim postseason hopes, remained 5½ games back of the Chicago Cubs for the second NL wild card with 11 to play and also would have to leapfrog Milwaukee, Philadelphia and the New York Mets.
At 52-98, the NL-worst Marlins matched their loss total of last year and appear headed to their first 100-defeat season since 2013.
Arizona's Robbie Ray pitched 5 2/3 innings of no-hit ball before Starlin Castro sent the left-hander's 86th pitch up the middle for single. The Diamondbacks led 3-0 at the time.
"We've had some tough losses so I just wanted to get the team out on the right foot in this series and set the tone," Ray said.
Ray was replaced in the seventh after walking the leadoff batter, and Yoan López allowed a two-run homer to pinch-hitter Neil Walker.
"One of the toughest things in all of baseball is pinch-hitting and in that situation you are just looking to get a pitch in the zone to do something with," Walker said.
López then gave up a single and a walk before being replaced by left-hander Andrew Chafin, who faced left-handed-hitting Magneuris Sierra. The speedy Sierra dropped a perfect bunt down the third-base line and Chafin — who wasn't going to get Sierra out anyway — made an errant throw to first that scored Lewis Brinson with the tying run.
Jon Berti hit a two-run single off right-hander Yoshihisa Hirano, the fourth pitcher of the inning, to push the Marlins ahead 5-3.
Then it was the Marlins turn to have a pitching breakdown.
Arizona sent eight batters to the plate in the seventh, punctuated by Lamb's two-out double down the right-field line.
"Nobody's working harder than Jake Lamb to make good moments happen," manager Torey Lovullo said. "We know what type of year he's having. It's been very frustrating. But to have him come through in that critical moment was a really good sign."
Ketel Marte hit an RBI double and Eduardo Escobar hit a solo homer for his 35th of the season.
Hirano (5-5) pitched a scoreless inning, and Kevin Ginkel got three straight outs for his first big league save. Tayron Guerrero (1-2) gave up three runs, two hits and a walk without getting any outs.
Arizona set a team record when Wilmer Flores, Josh Rojas and Jake Lamb were hit by pitches in the same inning by Pablo López. Flores was hit on the shoulder while Rojas and Lamb were both hit on a foot by breaking balls. Lamb was hit with the bases loaded, scoring Flores for a 1-0 lead.
Marlins: Miami claimed LHP Josh Smith off waivers from Cleveland and threw a scoreless eighth inning. The 29-year-old pitched eight games in relief this season for the Indians, striking out 12 over 8 1/3 innings.
Diamondbacks: Ray pitched well after battling a blister on the middle finger of his throwing hand over the last two starts. He lasted just two-thirds of an inning against the Mets on Sept. 11, giving up five runs. ... SS Nick Ahmed left the game in the eighth inning after a finger injury on his throwing hand. Lovullo said Ahmed's finger got hit by a bad hop and it peeled back his fingernail. ... RHP Archie Bradley was unavailable to pitch on Monday because of back spasms.
Marlins: Miami sends LHP Caleb Smith to the mound. He's got an 8-10 record with a 4.13 ERA.
Diamondbacks: Arizona LHP Alex Young will make his 14th start. He is 7-4 with a 3.38 ERA and set a club rookie record by striking out 12 against the Reds on Sept. 7.
More AP MLB: