The Avalanche (37-29-14) moved four points ahead of the Arizona Coyotes, who lost 3-1 to the Los Angeles Kings. Colorado is three points behind the Dallas Stars, who hold the first wild card.
"We still got two more games to win," Colorado coach Jared Bednar said.
[WATCH: All Oilers vs. Avalanche highlights]
The Avalanche scored six straight goals, four in a 7:08 span of the second period, after falling behind 2-0 in the first period.
"A little too much standing around, too cautious, not being the aggressors, and they end up getting a couple goals on us," Bednar said. "I liked our final 40 minutes, I had no problem with that at all. I liked the way we competed, we got on our toes, we were getting after their (defense), causing turnovers, making plays in all three zones."
Alexander Kerfoot scored two goals, and Semyon Varlamov made 27 saves for Colorado, which is 7-0-2 in the past nine games.
"I appreciate that the coach gave me a chance to play," said Varlamov, who hadn't played since March 15, a 5-3 loss to the Anaheim Ducks, because Philipp Grubauer went on a 6-0-2 run. "I'm sure it wasn't an easy decision because I haven't played for a long time. I was just trying to say focused and win this game. It's important for us, we're playing for the playoffs."
Video: EDM@COL: Kerfoot taps in go-ahead goal for Avalanche
Milan Lucic and Darnell Nurse scored for the Oilers (34-37-9), who have been eliminated from playoff contention and have lost four straight games and seven of the past nine (2-5-2). Mikko Koskinen made 23 saves.
"Frankly, there are a lot of people burnt out from chasing," Edmonton coach Ken Hitchcock said. "So every mistake is magnified, and it just seems like when you have to climb, climb, climb … it looks like we are tired doing the climbing. We look like a completely burnt team."
Lucic gave the Oilers a 1-0 lead at 9:20 of the first period when he deflected Matt Benning's shot from the right point off a pass from Ryan Nugent-Hopkins.
Nurse skated to Varlamov's left and scored from a sharp angle to give Edmonton a 2-0 lead at 13:01.
"When they scored that last goal, I was kind of upset," Varlamov said. "I knew it's an important game and it doesn't matter how the first period goes. I had to stay focused the whole game."
Nathan MacKinnon made it 2-1 at 4:56 of the second period when he skated through three Oilers at the blue line on his way to the net for his NHL career-high 40th goal and 400th NHL point.
"First period was terrible, unacceptable," Kerfoot said. "I thought we gained some momentum at the end of the period; we had a pretty good last five minutes. The goal that [MacKinnon] scored was huge and kind of got us kick-started, and we just went from there."
Tyson Barrie scored from the top of the right face-off circle to tie it 2-2 at 5:56.
Video: EDM@COL: Barrie uses quick release to beat Koskinen
The Avalanche went ahead 3-2 at 7:43. Matt Nieto was in front when he redirected Erik Johnson's shot to Kerfoot at the top of the crease for a tap-in.
Colin Wilson made it 4-2 at 12:04 when he spun above the left hash marks and put in a backhand.
Kerfoot made it 5-2 at 7:30 of the third period, putting in the rebound of Gabriel Landeskog's wraparound attempt.
The goal initially was disallowed by the referees for goaltender interference, a call upheld by the NHL Situation Room, which ruled the puck did not cross the goal line on Kerfoot's initial shot. But Bednar challenged, and the referees and Situation Room determined Kerfoot was making a play on a loose puck, which entered the net in a legal fashion.
Video: EDM@COL: Kerfoot nets second goal to pad lead
Colorado went ahead 6-2 at 15:07 when Sven Andrighetto scored from the slot off a pass from Tyson Jost from behind the net.
"We got some momentum and we ended up just kind of turning it up after that, and we were able to sort of take over," Landeskog said. "It was good to see all of the guys chipping in, and it was good to see everybody playing the right way. Once we started the second (period), I thought it was playoff hockey the way we played."
They said it
"If you're not playing meaningful hockey at this time, I'm sure it's tough to get up. I think a few of us said this morning our motivation needs to be playing for the guy next to us for the rest of the year." -- Oilers defenseman Darnell Nurse
"We did enough in those last two periods to get the two points, and I thought we played really good hockey. We made some great plays, and obviously they are a team that has recently been booted from the playoffs, so they are going to be a little down, and I think we exploited that a little bit." -- Avalanche defenseman Tyson Barrie
Video: Dunkin' NHL Comebacks: Avalanche storm past Oilers
Need to know
MacKinnon is Colorado's first 40-goal scorer since Milan Hejduk scored 50 goals in 2002-03. MacKinnon scored 39 last season. … Barrie, who had an assist on Kerfoot's second goal, has an NHL career-high 58 points (13 goals, 45 assists), the most by an Avalanche defenseman since Ray Bourque had 59 in 2000-01. Barrie had 57 last season. … Kerfoot has four goals and four assists in a six-game point streak.
Oilers: Host the San Jose Sharks on Thursday (9 p.m. ET; SNW, NBCSCA+, NHL.TV)
Avalanche: Host the Winnipeg Jets on Thursday (9 p.m. ET; ALT, TSN3, NHL.TV)
Video: Avalanche score six unanswered to top Oilers, 6-2