The winning pitcher was Mark Melancon (2-1), who tossed a scoreless ninth, while Hermann (0-2) was tagged with the loss. It was the second homer of the game for Turner, who has eight homers. It was the first walk-off homer of his career.
Philadelphia's Cameron Rupp, who had two hits, tied the game at 4 with a three-run homer with one out in the eighth on an 0-2 pitch from rookie reliever Koda Glover.
Turner made it 4-1 in the seventh with a laser two-run homer to left on the first pitch from Colton Murray.
Bryce Harper had an RBI single to drive in Daniel Murphy to give the Nationals a 2-1 lead in the sixth. Murphy led off with a career-high 41st double; he had 40 doubles with the New York Mets in 2012.
Washington starter Tanner Roark allowed one run on six hits with eight strikeouts in six innings before Blake Treinen pitched a perfect seventh.
The Phillies starter Jake Thompson gave up two runs in 5 1/3 innings as he lowered his ERA from 6.48 to 6.05.
Phillies outfielder Odubel Herrera, hitting .278, left the game with a right leg contusion. He doubled in the first and then was hit in the leg with a pitch in the fourth by Roark.
Washington's Anthony Rendon had an RBI double off the wall in center to tie the game at 1-1 in the fourth. It was the 36th double of the year for Rendon, who leads National League third basemen in that category.
Washington (83-58) assured itself it would stay at least eight games ahead of the New York Mets in the National League East. The Phillies (63-78) have lost 10 of their last 11 games to Washington.
NOTES: Washington manager Dusty Baker is hopeful that LHP Sammy Solis (2-3, 2.35 ERA) can return to the bullpen at some point. He has pitched in 34 games and has been on the disabled list since Aug. 17 with left shoulder inflammation. "He's doing fair. He has sort of hit a roadblock so to speak. We are trying to get him past that roadblock. Sammy has had a number of injuries in his young career already. We can use him, big time," Baker said. ... Phillies INF Maikel Franco (wrist) was out of the starting lineup for the third game in a row after he jammed his wrist while batting Tuesday. "I am going to say he is available to pinch-hit," manager Pete Mackanin said before Friday's game. Franco is hitting .246 with 22 homers in his first full MLB season. ... Washington RHP Max Scherzer (16-7, 2.88) starts Saturday against Phillies RHP Jerad Eickhoff (10-13, 3.86).