Phil Myers, a rookie defenseman who admitted he was just trying to throw a shot at the net, punched the air triumphantly, went down to his knees with joy, and jumped into teammate Travis Sanheim’s arms after the most important goal of his young career Wednesday afternoon in Toronto.

Thanks to Myers, the Flyers avoided one of the worst playoff collapses in franchise history.

They dominated the short overtime and survived, beating the New York Islanders, 4-3, on Myers’ dramatic goal at Scotiabank Arena.

Myers’ point drive, which deflected off Anders Lee’s stick high in the offensive zone and bounced past relief goalie Thomas Greiss, gave the Flyers the win with 17 minutes, 20 seconds left in overtime.

“I think every game is important, but this was probably our most important game of the season,” said center Kevin Hayes, who scored a pair of early goals during a Flyer-dominated first period.

For the 11th time since Jan. 7, the Flyers followed a loss with a victory – and this win, though more grueling than it should have been, was the most critical.

They got two goals from Hayes and built a 3-0 first-period lead, but they allowed two goals late in regulation.

The series is now tied at one win apiece.

The Flyers are 18-18 in series that were tied at 1-1. They are 3-15 when losing the first two games of a series.

Game 3 is Thursday at 7 p.m.

Taking a deft, off-the-sideboards pass from Sean Couturier, who was near the end line on the right, Myers found a lane and got into shooting position with traffic in front.

When we have the puck down low, they sort of collapse,” Myers said of the Isles, “so I was kind of calling for the pass from Coots and tried to get it on net as quickly as possible. It got a good bounce and went in. Really happy it did. We’ll take it.”

After blowing the 3-0 lead and allowing the tying goal late in regulation, the Flyers regrouped before the overtime period.

“We’ve been very good at protecting leads in the last quite a few games and tonight it got a little bit away from us, but at the end of the day, we found a way to get it done,” coach Alain Vigneault said.

The Islanders allowed the first three goals but got to within 3-2 when Anthony Beauvillier scored off a rush with 8:49 left in regulation, placing a shot under Carter Hart’s arm. At which point, visions of blowing a 3-0 regular-season lead to New York were probably dancing in Flyers’ fans heads.

And when Jean-Gabriel Pageau converted a turnover into the tying goal with 2:09 left in regulation, another meltdown became very possible.

The Flyers challenged the goal, saying New York was offside before Pageau scored. But they were denied after the replay and were thus given a delay-of-game penalty, which they killed.

“Totally my responsibility,” Vigneault said. “Bad call on my part. The linesman was right.”

Earlier in the third, Myers nearly gave his team a 4-2 lead as he ripped a shot off the post with 6:14 to go, and two minutes later, Hart (31 saves) denied Lee on a wraparound.

After the opening period, the Flyers looked like they would coast.

“We played more simple hockey, not trying to make the extra pass,” Couturier said about the Flyers’ 3-0 domination in the first period, one in which they chased goalie Semyon Varlamov. “We put pucks in deep and had a good forecheck. By doing that, we created some chances.”

Hayes had the first two-goal playoff game of his career, and he did it in the opening 9:43.

“He capitalized on those two-on-ones,” Couturier said. “Two big goals to start off the game.”

The Islanders actually had a handful of good early chances before Hayes, on a two-on-one, took a feed from Travis Konecny and his left-circle shot beat Varlamov to the short side just 1:57 after the opening faceoff.

Midway through the first, Hayes struck again. With Nic Aube-Kubel driving to the net from the right, Hayes beat Varlamov on a bad-angle shot from deep inside the left circle to make it 2-0. That gave the Flyers two goals on their first six shots.

With 4:51 to go in the first, a determined Couturier made a power move to get inside veteran defenseman Nick Leddy and scored his first goal in 11 postseason games this summer, increasing the lead to 3-0.

Exit Varlamov, who had shutouts in his previous two games and set a record for the longest scoreless streak in Islanders history early in Game 2.

Enter Greiss. (Varlamov will likely return to play Thursday night.)

The Islanders got to within 3-1 on a power-play goal by Lee, who had been robbed by Hart two minutes earlier.

Getting position on defenseman Matt Niskanen in front, Lee redirected Mathew Barzal’s slick crossing pass past Hart with 8:32 remaining in the second. The Islanders got the power play on a delay-of-game penalty on Jake Voracek.

The Isles came all the way back before the Flyers dominated the overtime.

“Obviously it’s a game that shouldn’t have gone into overtime,” Couturier said. “We should have been able to close it out. ... I like the way we responded after the third. Kind of like our team has done all year. Just kind of refocused and came out strong to start the OT. That’s the response we needed.”