NEW YORK (CBSNewYork/AP) — Hours after Mets captain David Wright announced he would be returning for one final homestand, his teammates staged an emotional and improbable comeback at Citi Field Thursday afternoon.

Down to their last out and trailing by a run, Wright’s teammates came through in the first game of their doubleheader. Michael Conforto and Todd Frazier hit back-to-back homers in the ninth inning as 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 change up 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 the Elias Sports Bureau. The Mets have five walk-off victories in this otherwise forgettable season. Only the 1962 and 1963 teams had more, with six.

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 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.”

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

The lefty retired 13 of 14 before allowing a double to Brian Anderson to start the seventh inning and was lifted after getting Lewis Brinson to fly out.

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)