Craig Anderson made 26 saves to win for the first time since Dec. 17 for Ottawa (26-43-6), which is last in the Eastern Conference and has been eliminated from playoff contention.
"It's been a long time coming," said Anderson, who was 0-13-1 in his previous 15 games. "Personally, it's been a tough stretch, obviously, to be close without [being able] to get there. Tonight we were able to get there and finalize it and get the win, and it's just a great feeling to have."
McDavid, Alex Chiasson and Colby Cave scored, and Mikko Koskinen made 31 saves for Edmonton.
"It's like when we lost to New Jersey (6-3 on March 13), it was the same type of team when you look at the standings," Chiasson said. "We played a little bit better tonight, overall, compared to that game, but the first period, it just feels like we don't respect our opponent. Tonight we play a team at the bottom of the standings and has traded away four or five of its best players and they outwork us. In our position, that is not good enough."