EDMONTON, Alberta (AP) It was a costly win for the Edmonton Oilers on Tuesday night

Connor McDavid, the overall No. 1 pick in the 2015 draft, had an upper-body injury that was described by coach Todd McLellan as ''long term.''

McDavid left the game late in the second period favoring his left shoulder after an awkward collision at full speed into the boards alongside Philadelphia defensemen Michael Del Zotto and Brandon Manning, who also lost their balance on the play.

More from FoxSports

He was seen wearing a sling in the hallway behind the dressing room and did not return for the third period. He had 12 points in his first 12 games and was named the NHL's Rookie of the Month for October.

McLellan said he was impressed how his team came together after the loss of the star rookie for a 4-2 victory over the Flyers.

''It was a really good sign to see us rallying around an 18-year-old,'' he said. ''It was good for our team because we did a lot of good things tonight. To come out on the short end of that game would have been very disappointing. There was a lot of fight in our group.''

Ryan Nugent-Hopkins scored twice and Taylor Hall had a goal and two assists for the Oilers.

Matt Hendricks also scored for the Oilers, who have won two of three, and outshot the Flyers 49-22.

''That was one of our better games this year, and the first period was our best period of the year,'' Nugent-Hopkins said. ''Right now there's just that confidence that we can get the job done.''

Scott Laughton and Ryan White scored for the Flyers, who have lost five straight.

''Any time you lose five in a row, you are pretty frustrated,'' White said. ''We are trying out there. Sometimes I think we are trying a little too hard. We just need to calm down and play. Right now we want it, but we just aren't doing the right things to make it happen. We need to step back and regroup and get back to the basics.''

The game was scoreless until the final seconds of the first period, when Edmonton scored on its 19th shot with 3.2 seconds remaining.

On a late power play, the Oilers were all over the Flyers net and Nugent-Hopkins was able to slip one by Philadelphia goalie Michal Neuvirth for this fourth of the season. Leon Draisaitl picked up an assist for his sixth point in three games since being called up, while Hall extended his points streak to six games with the other assist.

Philadelphia only had two shots on Edmonton goalie Anders Nilsson in the first period.

The Flyers scored 34 seconds into the second period as Laughton was able to bank a shot off Nilsson and in.

Philadelphia took a 2-1 lead with 7 minutes left in the period when a blast by White caromed off defenseman Eric Gryba and into the net.

Edmonton tied the game 6 minutes into the third as Hendricks picked up a big bounce off the glass and scored into a wide-open net.

The Oilers made it 3-2 just 1:27 later as Hall sent a long backhander on net that hit a skate and went in for his sixth of the season.

Nugent-Hopkins put the game away with an empty-netter.