WASHINGTON -- The Nationals took a commanding lead in the NL East this season with Dusty Baker steering the way. They moved one step closer to clinching a postseason berth without their manager in the dugout.
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).
"It was a pitcher's duel and Willie came through again," Roark said.
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.
"As we got into the ninth inning with that one-run lead, I got emotional," Speier said. "I was saying some powerful prayers. This one is for Dusty."
The Nationals have won five of six while lowering their magic number to seven.
"I think everybody is excited about it, being very close," Ramos said. "I think that's part of why we've been playing very well ... You can tell we're all tasting it a little bit."
Roark (15-8) allowed three hits with seven strikeouts and four walks, one intentional.
New York lost two of three in Washington to finish 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, one-half game back of the Giants and one-half game ahead of the Cardinals. San Francisco and St. Louis also lost Wednesday.
"We've got ourselves right where we need to be," Mets manager Terry Collins said. "Yeah, today's tough when the other two teams lose. But they're saying the same thing."
Roark threw at least seven shutout innings for a major league-leading ninth time this season.
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.
Mets starter Robert Gsellman tossed 5 2/3 scoreless innings, allowing five hits with four walks.
"We had a chance," Collins said. "But, you know, he's good, and we didn't get it done.
Bryce Harper struck out looking against reliever Josh Smoker with two runners on to end the sixth and finished 0 for 2 with a walk. He was also thrown out stealing to end the fourth as part of a double play.
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.
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. ... INF Wilmer Flores has been sitting out because a right wrist injury sustained Saturday in Atlanta, not because of neck soreness. "The neck is fine," Flores said. "I could've played with the neck. But it's just my wrist."
Nationals: Baker is expected to rejoin the team on Friday night for the series opener with the Atlanta Braves.
MARK YOUR CALENDAR:
Major League Baseball released the 2017 schedule Wednesday. New York hosts Atlanta April 2. Washington opens April 3 at home against Miami.
DRESSED FOR SUCCESS:
Washington's veterans headed out on the road trip wearing showy golf attire, including Kangol hats and plaid sweaters. The rookies were given ladies tennis clothing as part of some light hazing.
Mets: New York returns home with RHP Bartolo Colon (13-7, 3.27 ERA) to open a three-game series Friday against Minnesota.
Nationals: Max Scherzer (16-7, 2.78) aims for his fifth straight winning decision overall as Washington faces Atlanta on Friday.