NEW YORK — Pinch-hitter Jesse Winker led off the ninth inning with his first home run for the New York Mets, giving them another rousing 4-3 victory over the Baltimore Orioles on Wednesday. Mets starter Sean Manaea retired his first 17 batters and Mark Vientos put New York ahead 3-2 with a solo homer in the seventh. Francisco Lindor also went deep and J.

D. Martinez drove in a run with a grounder to help the Mets take two of three in the series. New York began the day 2 1/2 games behind Atlanta for the final National League playoff berth, with the Braves scheduled to host Philadelphia later.

“Huge series for us, especially winning two games the way we did it — walk-off homers against a really good team,” Mets manager Carlos Mendoza said. “Both times, we had the lead and we lost it late in the game and then we were able to find a way. And this is all about finding ways to win games.

” Following a 5-4 homestand, the Mets begin a pivotal 10-game trip Thursday night with the first of four at surging San Diego. “They’re playing well, but we’ll be ready for it,” Mendoza said. Edwin Díaz (5-1) struck out two in a perfect inning for his second win of the series.

The first came Monday night, when Francisco Alvarez’s solo homer in the ninth gave the Mets a 4-3 victory. Seranthony Domínguez (3-4) gave up both game-ending longballs. Baltimore began the day with a half-game lead in the AL East over the New York Yankees, who were set to host Cleveland across town We.