EDMONTON -- Charlie McAvoy scored at 3:10 of overtime and had an assist, and the Boston Bruins recovered after blowing a three-goal lead for a 6-5 win against the Edmonton Oilers at Rogers Place on Wednesday.

McAvoy deked and scored forehand-to-backhand after avoiding a poke check from Edmonton goalie Stuart Skinner.

Zach Hyman tied it 5-5 at 13:23 of the third period for the Oilers, who trailed 4-1 in the second period.

BOS@EDM: McAvoy makes brilliant move and nets the OT winner while falling down

“I think that’s an identity of ours,” Bruins goalie Jeremy Swayman said. “It was not exactly how we drew it up, but it was really special to get those two points and the way we did it through adversity and their push, I think that’s really something special for our group moving forward. The mentality our group has is just do whatever you need to do to win, no matter whether it’s a 1-0 game or a 6-5 game, we’re going to do whatever it takes to win.

“We know how valuable every point in this league is, especially at this stage in the year, and it’s really special to see our group come together and fight through no matter what comes our way.”

David Pastrnak and Jake DeBrusk each had a goal and an assist, and Mason Lohrei had three assists for the Bruins (34-12-11), who have won the first two of a four-game road trip. Swayman made 37 saves.

“I just loved the way we kept forging ahead,” Boston coach Jim Montgomery said. “We didn’t worry about what happened, positively or negatively, I thought we continued to play. Obviously, they had a great push by a great team in the third period and it kind of snowballed, but we went right back to work afterward.

“When they made it 4-4, the next four minutes I thought we controlled the game and started to push back. We got the ‘Pasta’ goal and they came back, it was great for the fans.”

Warren Foegele scored twice, and Connor McDavid had two assists to extend his home point streak to 20 games for the Oilers (33-18-2), who had won two in a row and nine straight at home. Skinner made 30 saves.

McDavid, who has 14 assists in his past five games and 64 to lead the NHL this season, has 12 goals and 36 assists during his 20-game home point streak. He became the sixth player in NHL history to have multiple 20-game home point streaks (21 games last season).

Foegele moved up to Edmonton’s top line with McDavid and Hyman because Ryan Nugent-Hopkins (illness) was out.

“We missed him, but throughout the year you’re going to be missing some of your better players,” Oilers coach Kris Knoblauch said. “It’s an opportunity for somebody to stand up and an opportunity for Foegele tonight. He absolutely stood up.”

Foegele cut it to 4-2 at 15:27 of the second period after backhanding in a centering pass by Hyman.

“It's great that we got that point, and we fought our way back,” Foegele said. “But it just felt like a game where we made a really good push. I really thought we were going to get the win. We’ve got to have a better second period. It felt like today, even though the goals were going in, that we actually had a better second period.

“But it's something that's bleeding into our game, and something we know we’ve got to improve on.”

BOS@EDM: Pastrnak fires home a shot from the hash marks

Mattias Janmark made it 4-3 at 6:14 of the third period, tapping in a rebound after a slap shot from the point by Cody Ceci trickled through the legs of Swayman.

Corey Perry tied it 4-4 at 7:24 on a rebound off a point shot by Darnell Nurse.

Pastrnak responded to give Boston a 5-4 lead at 12:41, picking up a failed clearing attempt by Oilers forward Evander Kane, walking it in from the blue line and shooting past Skinner’s glove.

Hyman tied it 5-5 on a rebound 42 seconds later off a point shot by Mattias Ekholm.

“You are happy with the way you battled back from down 4-1 to a really good team, to be able to come back twice and earn a point says a lot about our team and how it faces adversity,” Hyman said. “But at the same time, you don’t want to put yourselves in that position.

“Since we have been back (from the All-Star break) we have put ourselves in that position too often and we have to learn to play consistently throughout the whole game again.”

BOS@EDM: Hyman evens the score with a goal in front

Morgan Geekie gave the Bruins a 1-0 lead at 2:34 of the first period on the power play with a wrist shot from the blue line that beat Skinner high glove side.

Foegele tied it 1-1 at 11:40, deking his way into the crease and sliding it through the pads of Swayman after McDavid poked the puck away from Bruins defenseman Derek Forbort.

Brad Marchand’s goal 25 seconds into the second put Boston ahead 2-1. He skated in from the blue line and scored on a wrist shot from the left face-off dot that beat Skinner stick side.

Trent Frederic extended it to 3-1 at 4:40, redirecting a soft pass from Jesper Boqvist and banking it in off the far post.

DeBrusk pushed it to 4-1 at 13:57 when he backhanded in a short rebound off a wrist shot by Pastrnak from the blue line.

NOTES: Pastrnak has seven points (three goals, four assists) during a five-game point streak and needs one more to become the 10th player in Bruins history to reach 700 points. … McAvoy has seven points (two goals, five assists) in a five-game point streak. … The Oilers are 4-3-1 since their 16-game winning streak ended coming out of the All-Star break. They’ve allowed 11 power-play goals in seven games.