It is the third time McDavid has had five points in an NHL game.
Leon Draisaitl had two goals and an assist, Ryan Nugent-Hopkins had a goal and an assist, and Mikko Koskinen made an NHL career-high 49 saves for Edmonton (6-1-0), which was outshot 52-22.
WATCH: [All Flyers vs. Oilers highlights]
"[Koskinen] was the first, second and third star, he was the only reason we won," Oilers coach Dave Tippett said. "It wasn't a 6-3 game or a 6-1 game. The score was that, but it wasn't that kind of game."
Jakub Voracek had two goals and an assist for Philadelphia (2-2-1), which has lost three straight. Carter Hart allowed four goals on 14 shots before being replaced in the second period by Brian Elliott, who made six saves.
"Sometimes the game looks unfair, but I'm a firm believer that if you do things the right way, things will even out," Flyers coach Alain Vigneault said. "We had some great looks, the right guys had the looks, but their goaltender was the difference-maker in tonight's game. He played exceptionally well."
Draisaitl scored on Edmonton's first shot of the game 1:13 into the first period to make it 1-0, but Voracek tied it 1-1 on the power play at 7:36.