After falling behind by four runs, the Marlins claimed a 5-4 advantage with three runs in the sixth inning. Gorkys Hernandez and Christian Yelich each hit RBI doubles, and Kyle Skipworth's sacrifice fly gave Miami the edge.
Powered by two home runs in the third inning, the Mets claimed a 4-0 lead. Brandon Hicks connected on a solo shot, and former Marlin John Buck blasted a three-run homer.
Both starters were stretched to more than two innings.
Dillon Gee threw three scoreless innings for New York. The right-hander, who hurled 50 pitches, received a lift from center fielder Kirk Nieuwenhuis, who made a diving catch in center field to rob Juan Pierre of extra bases to lead off the first inning.
Marlins starter Nathan Eovaldi was impressive in his first two innings, but he was hurt by a home run and a two-out walk, which set the stage for the Met's four-run third.
Eovaldi retired the first seven batters he faced, striking out four. But with one out in the third inning, the right-hander was victimized by Hicks' home run, which came on an 0-2 pitch. Josh Satin then slapped a single. And with two outs, Eovaldi walked Omar Quintanilla, which proved costly.
Eovaldi was lifted after 47 pitches, and Tom Koehler entered with two inherited baserunners. Facing his former teammate Buck, Koehler surrendered a three-run homer.
In the fifth inning, the Marlins trimmed their deficit to 4-2 on Adeiny Hechavarria's two-run double.
Up next: The Marlins are off on Monday. On Tuesday at 7 p.m. ET, they will take on Team Venezuela, practicing in Jupiter in preparation for the World Baseball Classic. Wade LeBlanc will get the start for Miami. Venezuela has yet to determine its starter. Marlins right-hander Henderson Alvarez is pitching for Venezuela. Placido Polanco, who is resting a tight back, hopes to play.
Joe Frisaro is a reporter for MLB.com. He writes a blog, called The Fish Pond. Follow him on Twitter @JoeFrisaro. This story was not subject to the approval of Major League Baseball or its clubs.