Dominic Smith can spend the offseason gloating.

After pushing for a return from a stress fracture in his left foot for the past two months, the Mets first baseman/outfielder finally received an opportunity in Sunday’s 11th inning.

Smith, in his first plate appearance since July 26, delivered with a three-run walk-off homer that gave the Mets a 7-6 victory over the Braves in the season finale.

“For me, all I wanted to do was get back this year,” Smith said. “I didn’t care what I did for the rest of the year, all I cared about was my team winning. We obviously got eliminated, but we fought until the last week. You can’t count this group out.”

Smith was told several weeks ago that his season was finished, but continued to rehab for a chance in these final few games. He was activated on Thursday, but remained on the bench until entering Sunday’s game as a defensive replacement for Pete Alonso in the 11th inning.

“I couldn’t have dreamed of anything like this,” Smith said. “If I had gone up there and got out I would have been just as satisfied, just as happy to make it back.”

The Braves had blasted two homers against Walker Lockett in the previous half-inning to take control of the game.

But Tomas Nido and Wilson Ramos each singled in the bottom of the inning before Smith cleared the fence in right-center against Grant Dayton for his first career walk-off homer.

The Mets finished 86-76, third in the NL East.

Adeiny Hechavarria, who made a point of recently saying he was glad the Mets released him last month, homered in the ninth and 11th innings.

Paul Sewald surrendered a game-tying blast to Hechavarria leading off the ninth before the veteran infielder homered against Lockett in the 11th. Adam Duvall also went deep in the final inning.

Noah Syndergaard snapped a streak of four straight starts in which he allowed four runs. The right-hander lasted seven innings and surrendered three earned runs on five hits with nine strikeouts and two walks. He finished with a 4.28 ERA, heading into an uncertain offseason in which the Mets could look to trade him.

Pete Alonso went 1-for-5, but did not homer. The rookie first baseman finished with 53 homers to become the first Mets player to conclude the season as MLB’s home-run leader. Alonso’s homer Saturday moved him ahead of Aaron Judge for the rookie record.

J.D. Davis blasted a two-run homer in the first inning and finished with a .354 batting average at home this season. The mark is the third-highest in team history for players with at least 200 at-bats at home. Davis’ 1.078 OPS at home was the highest in Mets history.