The win was critical because the surging Braves won again -- Atlanta has won nine of its last 11 -- but the Nationals were able to maintain their four-game lead in the National League East standings and decrease their magic number to clinch the division to four with seven games remaining.
"These are all big games coming down here," Werth said. "Obviously, Atlanta's running games off, so we're going to have to take care of business ourselves. That's a big-time lineup over there, so to push a couple across to extend the lead -- at this point in time in the season, emotions are running high, and I was just happy to get the runs across."
Werth, the former Phillies All-Star who helped lead the club to a World Series title in 2008 but left for Washington as a free agent in December 2010, stepped to the plate in the top of the ninth with the Nats leading, 5-4, and men on second and third.
Philadelphia had clawed back out of a 5-0 hole and the crowd was back into it after Tyler Clippard surrendered a run in the eighth and was booing Werth loudly as he dug in.
"These fans going crazy, booing him, telling him he sucks and whatnot, they don't know what they're missing," Nats outfielder Bryce Harper said. "He's an unbelievable ballplayer and he's been clutch for us all year. He's what gets us going."
Werth did get the Nats going with a leadoff walk in the first, but it was the two-run single he delivered in the ninth -- before scoring on a Harper triple -- that sealed it.
"I think he feeds off the boos," manager Davey Johnson said. "I think sometimes he gets too amped up here, but the boos kinda get him real focused, and that was a huge hit he got."
It gave starter John Lannan just his second career win in eight starts in Philadelphia, as he lowered his ERA at the ballpark from 7.06 to 6.49. He's now 4-0 this season, and 2-0 this month since taking Stephen Strasburg's place in the rotation.
A third-inning jam that Lannan worked out of, when the bases were loaded for Ryan Howard and Carlos Ruiz, was likely the early difference between his losses of the past and his win Wednesday.
"I've been in that situation here so many times and come up short, so I told myself not to do what I did back then," Lannan said. "I don't even know what I was doing, I just told myself I wasn't going to let it happen because it's happened so many times here. I kind of was fed up with it, and kind of just went from there."
He was given an early lead when the Nationals broke the game open the first time through the lineup. With rain in the Philadelphia area before game time, the Nats called off batting practice shortly after they took the field to stretch. Kyle Kendrick did the honors instead.
Three of the righty's first 22 pitches were deposited in the outfield seats as Harper (his 20th), Ian Desmond (25th) and Kurt Suzuki (sixth) did the damage.
Harper also stole second base the following inning, becoming the first teenager to record at least 17 homers and 17 stolen bases in a season. Tony Conigliaro (24) is the only player in baseball history to have hit more homers than Harper before turning 20 years old.
"I don't know if he was sitting changeup, but [Harper] put a good swing on it," Kendrick said. "They put some good swings on some balls. The home run to Suzuki was a pretty good pitch, too. Most of the night I was behind in the count and up in the zone."
The Phillies scored twice off Lannan, once in the third and once in the fourth, and also chipped away against relievers Ryan Mattheus and Clippard before Drew Storen pitched a perfect ninth in front of a suddenly subdued Phillies crowd.