Lucas Duda took a big swing in the 11th inning on Sunday and propelled the exhausted Mets toward victory.

With Duda’s two-run homer as the difference, the Mets beat the Phillies 4-3 in 11 innings at Citizens Bank Park for a fifth victory in six games.

The fact the game was decided before the 14th was the real news: The Phillies won in the 14th inning on Friday before the Mets countered a day later on David Wright’s RBI single in the 14th.

Jenrry Mejia surrendered a solo homer to Marlon Byrd in the 11th on Sunday, but recovered to get the final two outs for his sixth save.

The teams are scheduled to conclude this five-game series on Monday.

Jon Niese lasted eight innings for the Mets and allowed two earned runs on eight hits with one walk and six strikeouts. The lefty needed only 91 pitches and might have continued had his turn in the batting order not come in the ninth.

But when Ruben Tejada was thrown out attempting to steal second to end the eighth — he slid past the bag — Niese was left standing at the plate.