McDavid won it off a centering pass from Leon Draisaitl on a 2-on-1 after Mike Smith made a save on Blues defenseman Nick Leddy.
"It was a good start, 4-1 at the end of the first, we'll take that any night," McDavid said. "Credit to [the Blues], I thought they did a good job of adjusting and making it hard on us, and they got themselves back in the game. Ultimately, we hung in there, and it sounds cliche, but that's really all that matters."
McDavid and Zach Hyman each scored two goals, Draisaitl had two assists, and Smith made 31 saves for the Oilers (39-25-5), who tied a franchise record with their ninth consecutive home win and moved one point behind the Los Angeles Kings for second place in the Pacific Division.
"I'm pleased we found a way to get the two points, that's first and foremost the goal heading into each and every night," Edmonton coach Jay Woodcroft said. "We found a way to get it done, but there was some sloppy play that I think has to get cleaned up. But anytime you score six goals on a team like that, I think that's a positive sign."