NEW YORK (AP) A day after scoring 13 runs in a rain-delayed affair that ended after midnight, it looked like the Mets didn't have much left in the tank for the first game of Thursday's doubleheader against Miami.

Down to their last out and trailing by a run, they came through.

Michael Conforto and Todd Frazier hit back-to-back homers in the ninth inning, and New York stunned the Marlins 4-3.

Kyle Barraclough entered with one out in the ninth and retired pinch-hitter Dominic Smith before Conforto lined a 1-0 changeup into the second deck in right to tie the game. Frazier followed by hitting a 1-1 pitch into the seats in left-center field, prompting his teammates to rush from the dugout and mob the veteran third baseman as he crossed home.

''I was hoping that Michael got on. He did his job, and in my mind I was trying to hit a home run,'' Frazier said. ''Those rarely happen. Got a pitch to hit and kind of squeaked one over, so we'll take it.''

It was the first time in franchise history that the Mets hit back-to-back homers in a walk-off win, according to Elias. The Mets have five walk-off victories in this otherwise forgettable season. Only the 1962 and 1963 teams had more, with six.

Barraclough (0-6) blew a save for the seventh time in 17 opportunities.

Jerry Blevins (3-2) pitched a scoreless ninth for the win.

Rookie starter Sandy Alcantara befuddled the Mets' lineup, permitting just two hits, with his only real blemish coming off the bat of the opposing pitcher. Steven Matz hit his first career homer, jumping on a first-pitch fastball for a two-run shot into the left-field seats in the second inning to tie the game at 2.

''It was just a bad pitch to Matz, but other than that I was able to settle back in and get going,'' Alcantara said through a translator.

It was the first homer by a Mets pitcher since Seth Lugo hit one on July 15, 2017.

''Definitely got all of it,'' Matz said. ''Felt good to get my first one.''

Peter O'Brien and Isaac Galloway went deep in the top of the second against Matz. Galloway's third long ball of the year traveled an estimated 408 feet into the second deck in left.

Playing in front of a sparse crowd with several hundred fans scattered around Citi Field, both clubs then traded zeroes until the seventh.

Matz retired 13 of 14 before allowing a double to Brian Anderson to start the inning and was lifted after getting Lewis Brinson to fly out. O'Brien lined Drew Smith's first pitch into the right-field corner for a run-scoring single.

Adam Conley pitched a scoreless eighth, stranding a runner left by Alcantara, and retired Jay Bruce to start the ninth before being lifted for Barraclough.

Matz allowed three runs on three hits in 6 1/3 innings, walking two and striking out four.

Alcantara also faced the Mets on June 29 in Miami, earning his first big league win behind five innings of one-run ball.

TRAINER'S ROOM

Marlins: OF Austin Dean was a late scratch because of nausea.

Mets: 3B David Wright (back/shoulder) is expected to be activated from the 60-day disabled list when the team returns home Sept. 25, and is slated to start at third base on Sept. 29 against Miami in what could be the final game of his major league career. ... C Devin Mesoraco (bulging disk in back) is almost pain-free and could be close to returning, manager Mickey Callaway said.

UP NEXT

Marlins: RHP Jeff Brigham (0-1, 9.00 ERA) took the mound in the nightcap, making his second big league appearance.

Mets: LHP Jason Vargas (5-9, 6.75 ERA) has won three of his last four starts, lasting at least 5 1/3 innings in four or five.

---

More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports

Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.