Travis Konecny, Ivan Provorov and Scott Laughton scored, and Brian Elliott made 17 saves for Philadelphia (13-8-3), which has lost four of six games.
The Flyers had 13 giveaways, including seven in the first period.
"There's plays with the puck that you need to make in all three of those zones," Philadelphia coach Alain Vigneault said. "And, unfortunately, in their end we made some costly mistakes that led to rush opportunities that they were able to put in the back of our net. We had a push in the third, but it was obviously too late."
The teams will play again here Saturday.
The Capitals led 4-1 after the second period, but Provorov scored at 4-on-4 to make it 4-2 at 1:43 of the third period, and Laughton got the Flyers within 4-3 at 10:45.
It was reminiscent of what happened to the Capitals against the New Jersey Devils on Tuesday, when they led 4-1 in the third period before winning 5-4 in overtime.
"The other night, the wheels were coming off quickly, and by the end you're hanging on by a lug nut, and tonight was totally different," Washington coach Peter Laviolette said. "They were able to capitalize on a couple of chances. ... But from an even-strength defensive standpoint, I'm going to say we didn't give up six or seven chances the entire night that were quality chances. So I was really happy with the game."
Ovechkin gave the Capitals a 1-0 lead at 8:37 of the first period when he scored unassisted off a giveaway by Provorov.