WASHINGTON — Yes, the Mets lost a chance to gain ground in their postseason push. It’s also true they dropped two of three to the Nationals. Here’s another fact: New York put itself in position for the playoffs with its recent surge, a point manager Terry Collins intends on pushing.

Tanner Roark pitched seven scoreless innings and Wilson Ramos homered in the seventh inning for the game’s only run as the Washington Nationals beat the New York Mets 1-0 on Wednesday.

With one out in the seventh, Ramos hit his 21st home run deep over the center-field wall on the first pitch from Fernando Salas (0-1).

New York finished 6-3 on its nine-game road trip. The Mets had won eight of 10 and were 17-6 over their previous 23 games.

Entering Wednesday, the Mets were the second NL wild card, a half-game back of the Giants and a half-game ahead of the Cardinals. San Francisco and St. Louis also lost Wednesday.

“We’ve got ourselves right where we need to be,” Collins said. “Yeah, today’s tough when the other two teams lose. But they’re saying the same thing.”

Salas, who was 3-6 with the Angels, had not allowed a run in seven appearances since being acquired from Los Angeles on Aug. 31.

Roark (15-8) allowed three hits with seven strikeouts and four walks, one intentional. The Nationals have won five of six.

Reliever Blake Treinen pitched the eighth and Mark Melancon got the final three outs for his 42 save.

Mets starter Robert Gsellman tossed 5 2/3 scoreless innings, allowing five hits with four walks.

Holding the Nationals to one run for a 3-1 win in New York on Sept. 3 helped boost the rookie in the rematch.

“Definitely, it’s big,” Gsellman said. “It helped my confidence a lot, and hopefully will take it to the next level.”

New York returns home for a 10-game homestand starting Friday.

“We’re going home in the wild-card hunt. Our fans should be excited,” Collins stated. “They’ve been waiting. It’s the last homestand. They should be excited to come out and, you know, see what happens in these 10 games. I don’t care who we’re playing, they’re big games. This is a big time of year.”

Nationals manager Dusty Baker was not with the team in the series finale because of a death in the family. Bench coach Chris Speier managed team in Baker’s absence.

Roark is 1-2 with a 1.27 ERA in four appearances against the Mets this season including three starts. The right-hander threw at least seven shutouts innings for a major league-leading ninth time this season.

New York opened the game with back-to-back singles and loaded the bases with one out, but Roark escaped by striking out Jay Bruce and getting T.J. Rivera on a fly ball.

“We had a chance,” Collins said. “But, you know, he’s good, and we didn’t get it done.”

Washington won the season series 12-7.

Daniel Murphy’s single in the first inning extended his hitting streak to 12 games overall and meant at least one hit in all 19 games against his former team this season.

MARK YOUR CALENDAR

Major League Baseball released the 2017 schedule Wednesday. New York hosts Atlanta April 2.

TRAINER’S ROOM

Mets: LHP Steven Matz (left shoulder tightness), on the disabled list retroactive to Aug. 15, felt “fine” throwing a 20-pitch bullpen session for Single-A Port St. Lucie, Mets manager Terry Collins said. … Noah Syndergaard’s turn in the rotation comes Sunday, but Collins said he prefer giving the ace extra rest. Syndergaard struck out 10 over seven innings in New York’s 4-3 win in 10 innings Tuesday.

UP NEXT

Mets: New York returns home to open a three-game series Friday against Minnesota with RHP Bartolo Colon (13-7, 3.27 ERA) set to face Jose Berrios (2-6, 9.27)