The star forward was held without a point in his previous three games, all losses to the Toronto Maple Leafs.
''I think it's a big win,'' McDavid said. ''When you're sliding like we were, sometimes it's tough to find a way out of it. I thought we did a good job as an entire group of just staying with it, sticking with it. Holding onto that game even though we probably didn't get off to our best start.''
Kailer Yamamoto tied it 2-all early in the third period and assisted on McDavid's winner. Jesse Puljujarvi also scored for the Oilers (15-11-0), and Kris Russell had two assists.
Johnny Gaudreau and Noah Hanifin had goals for the Flames (11-12-2) in their first game since coach Geoff Ward was fired and replaced by Darryl Sutter. Calgary assistant Ryan Huska served as head coach, with Sutter set to join the team Monday.
Gaudreau converted on the power play, and Hanifin got his first of the season.
''I thought we had a really good start,'' Hanifin said. ''It was a pretty back-and-forth game after that. It's a rivalry game. It's always going to be competitive. It stings as a loss. But I think we competed. If we play that way and we compete that way, we'll have more success than not.''
Mike Smith made 34 saves in the win. Jacob Markstrom stopped 30 shots for Calgary.
Smith had 20 saves in the first period.
Edmonton defenseman Darnell Nurse and Calgary forward Milan Lucic dropped the gloves for a spirited fight in front of the Flames' bench. Not to be outdone, Oilers forward James Neal and Flames forward Matthew Tkachuk also exchanged fisticuffs with a little more than three minutes to play in the first period.
''I loved it,'' McDavid said. ''(Nurse) taking on the big man is something special and it for sure got us going. (Neal) to drop them with Tkachuk obviously is an emotional one for our group and got us going as well. Hats off to both of those guys.''
McDavid gave Edmonton its first lead with his 15th goal this season and fourth game-winner.
The Oilers paid tribute to Wayne Gretzky's father, Walter, prior to puck drop. The team played a video commemorating the late father of the Edmonton great before holding a moment of silence. Walter Gretzky died Thursday at age 82.
Flames: Host the Ottawa Senators on Sunday night to start a five-game homestand.
Oilers: Host the Senators on Monday night to begin a three-game series.
More AP NHL: https://apnews.com/hub/NHL and https://twitter.com/AP-Sports
Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.