Wilmer Difo drove in the go-ahead run with an RBI single in the seventh inning and Anibal Sanchez pitched seven solid innings as the Nationals beat the Phillies 5-2 on Wednesday night.
The Nationals maintained a one-game lead over Milwaukee in the race for the top NL wild card.
Washington trailed 2-1 when Asdrubal Cabrera singled and Yan Gomes doubled with one out in the seventh. Victor Robles followed with a sacrifice fly that tied the game. Difo, making his first start since May 16, followed with a single to right-center off reliever Mike Morin (1-3) that scored Gomes.
''He gets a chance to play and plays good defense, gets a couple hits - big hit - but he played really well,'' manager Dave Martinez said of Difo. ''We talk about that all year long, about utilizing every guy you have on the roster and that's a perfect example of him just being ready to play when he's called upon.''
Howie Kendrick and Brian Dozier homered for the Nationals, who have won four straight.
With shortstop Trea Turner and third baseman Anthony Rendon rested, Difo started at short, Cabrera moved from second to third and Dozier started at second and hit leadoff.
''We had fun last night,'' Dozier said. ''It was good. Obviously, we're still fighting. All these (games) definitely matter.''
Sanchez (11-8) allowed two runs and six hits, striking out seven without a walk. Sean Doolittle earned his first save since a stint on the injured list. He pitched a scoreless ninth for his 29th save in 35 attempts and first since Aug. 16.
Brad Miller hit a solo homer in the seventh, his third in two games, and Bryce Harper had two hits for the Phillies, who have lost five straight.
Phillies starter Drew Smyly allowed two runs in 6 1/3 and struck out a season-high 10 batters.
Harper expressed his displeasure with Nationals fans who taunted him in right field. He said the language coming from the stands over the first seven innings was what he usually hears on the road, but it got worse over the final two innings, though Harper declined to reveal what was said.
''I guess that's what it is nowadays,'' Harper said when asked if he was surprised by the vitriol. ''Like I said the whole time, I've got 60,000 fans up in Philly that appreciate me as a player, appreciate me as an individual and my family as well. I owe a lot to those people up there in Philly because they show up for me every single night and they're there to cheer us on and boo us and keep us going as a team and as individuals as well. I'm looking forward to the next 12 years. Can't wait.''
While Anthony Rendon and Trea Turner rested, Kendrick, Juan Soto, Adam Eaton and Victor Robles were in the lineup.
''I still want to play these games to win,'' Nationals manager Davey Martinez said. ''But we got to be smart about giving guys some days off. Today is no Anthony, no Trea. Both deserve days off, obviously. We'll see how it goes, and hopefully get Juan a couple of days off in the near future.''
With the Phillies eliminated from playoff contention Tuesday, Gabe Kapler was asked about his future with the club. He is 159-161 with the Phillies, who spent heavily in free agency in the offseason but will miss the postseason for the eighth consecutive year.
''There's going to be time to reflect on my future when we get to the end of the season,'' Kapler said. ''Right now, my job is to continue to stay focused on managing the major league club and devoting myself to the organization, and I'm going to continue to do that through the end.''
Phillies: C J.T. Realmuto will miss the remainder of the season with a right knee injury. Kapler said Realmuto has returned to Philadelphia and will undergo a ''meniscus cleanup'' on Friday. ''There's no long-term concerns about this for J.T.,'' Kapler said.
Nationals: C Kurt Suzuki (elbow) was working on throws to the bases before the game. He hasn't started a game since Sept. 5. ''He threw about 90 percent, feels good,'' Martinez said. ''So we will do it again tomorrow, see how he feels. I'm shooting for maybe Friday and Saturday to get him in the game.''
Phillies: LHP Jason Vargas (7-8, 4.40 ERA) makes his final start of the season as the five-game series concludes.
Nationals: RHP Stephen Strasburg (17-6, 3.37) is 13-2 with a 2.62 ERA in 26 career starts versus the Phillies.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Copyright 2019 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.