The Mets needed so many things to go right that at times, the task seemed too overwhelming. Then, one by one, it started happening.

In moments big and small, in ways obvious to all and almost imperceptible, the Mets passed individual tests of mettle. The sum of it all was a gratifying 7-5 victory over the Marlins, giving the Mets (7-3) their fifth straight victory, their longest winning streak since May 26-30, 2013.

"A year ago, we don't win tonight in that particular situation," manager Terry Collins said after the Mets seized sole possession of first place in the National League East.

A year ago, lefthanders rendered slugger Lucas Duda almost useless. But on Thursday night, it was Duda who snapped a 5-5 tie with two outs in the seventh inning, ripping an opposite-field single off tough Marlins lefty Mike Dunn five pitches after falling behind 0-and-2.

Michael Cuddyer followed with an infield single to tack on an insurance run, just one of a handful of plays that gave the Mets their third consecutive come-from-behind victory.

"That's when you know things are going well. Everybody's contributing," said Duda, 4-for-8 against lefties to start the season. "Things are going your way."

advertisement | advertise on newsday

It did not come easy. In a back-and-forth affair, the Mets rallied from a 3-0 deficit, blew a 5-4 lead, then found themselves tied again when a lengthy review in the seventh inning gave the Marlins the tying run on a bizarre play at home plate.

After 5 minutes, 44 seconds, umpires ruled that Mets catcher Travis d'Arnaud had indeed missed his attempt to tag Ichiro Suzuki, who scrambled back to the plate to score the tying run.

A lesser team might have crumbled. But the Mets summoned another rally, as they've done often this season.

Carlos Torres survived a leadoff double to pitch a scoreless eighth ahead of Jeurys Familia, who nailed down his fourth save.

"We never give up," d'Arnaud said. "We believe we have a chance to win every game."

Mets videos

Giancarlo Stanton hit a two-run homer in the first and Martin Prado added a solo shot in the fourth to give the Marlins a 3-0 lead over Dillon Gee, who was chased after yielding four runs in 51/3 innings.

But embattled shortstop Wilmer Flores emerged from his slump to smash a tying three-run homer in the fifth. It was only his second hit of the homestand.

When the Marlins pushed ahead in the sixth on reliever Rafael Montero's bases-loaded walk, the Mets kept the inning from getting out of hand.

D'Arnaud caught Dee Gordon stealing second, Cuddyer cut off a ball in the gap to save a run and Curtis Granderson ended the inning by running down J.T. Realmuto's bases-loaded drive to rightfield. Though Granderson's momentum sent him crashing into the fence, he held on.

After Cuddyer delivered a tying single in the sixth, Eric Campbell gave the Mets their first lead on a sacrifice fly that came on the eighth pitch of his at-bat.

advertisement | advertise on newsday

"Those are plays that don't really make highlight reels," Duda said. "But they are instrumental to us winning and we got quite a few of those today."

In their first 10 games, the Mets lost closer Jenrry Mejia to a PED suspension, leaving the bullpen in what Collins called "disarray." They also lost David Wright to a hamstring injury, a wound still fresh when the Mets faced the Marlins Thursday night.

But in a season filled with expectations, the Mets have stood up to those body blows.