Duda went 3-for-4 with two doubles, Michael Cuddyer drove in a pair and Wilmer Flores added a three-run homer for the Mets, who last won five straight from May 26-30, 2013.
Giancarlo Stanton became the Marlins' all-time home run leader with a two-run shot, while Martin Prado hit a solo homer in the opener of this four-game set.
Miami made it 5-5 in the seventh inning thanks to a lengthy replay review on a plate at the plate.
Ichiro Suzuki, after tripling to the right-field gap, was originally called out trying to score on a sharp grounder to second. Daniel Murphy's throw pulled Travis d'Arnaud up the first-base line, and the catcher made a diving attempt to tag out Suzuki, who pleaded his case and won when replay showed him narrowly avoiding the tag and touching home plate on his second attempt.
The Mets rebounded quickly with two runs off Mike Dunn (0-1) in the home half. Duda stepped in with two on and two outs and, after fouling off three straight 1-2 pitches, hit a line drive to left-center that fell just out of Christian Yelich's reach. John Mayberry Jr. scored on the single, and Cuddyer tacked on an insurance run with an RBI dribbler up the third-base line.
Neither starter factored in the decision after being pulled in the middle of the sixth. Mets starter Dillon Gee surrendered four runs on five hits, while Jarred Cosart was charged with five runs on seven hits.
Stanton's two-run homer in the first inning was the 155th of his career, moving him past Dan Uggla for the franchise lead.
Prado added a solo shot deep to left-center in the fourth, and it stayed 3-0 until Flores took Cosart deep in the fifth. Eric Campbell and Juan Lagares singled ahead of Flores' tying blast.
Gee was pulled with two outs in the sixth after his second walk of the inning loaded the bases. Rafael Montero came on in relief and walked in a run, but the Mets got two runs back in their half to take their first lead.
Duda doubled into the right-field corner and came around on a single from Cuddyer, who scored the go-ahead run on Campbell's sacrifice fly.
Gee has made 48 straight starts of at least five innings ... Stanton has homered in each of his last four games against the Mets ... Duda has six multi-hit games this season and is hitting .395.