The Flyers have used a quirky formula to climb up the standings. Get outplayed, get outshot, and win anyway.

Kevin Hayes scored a power-play goal with 37 seconds left in overtime as the Flyers won their fourth in a row and second in two nights over the Islanders, 4-3, on Sunday at the Wells Fargo Center.

The Flyers, for all the griping about being constantly outplayed, have moved into a virtual tie with Washington atop the East Division with 15 points. The Capitals hold the tiebreaker by virtue of playing one fewer game.

Sunday’s start was a little flat, and they blew a two-goal lead in the third period, but overall the Flyers hung with the Islanders, who had knocked them out of last season’s playoffs in seven games.

“It’s a resilient group,” said Hayes, who scored the winner off a sweetheart pass from Claude Giroux. “It’s very easy to point fingers and start panicking, but that doesn’t happen here.”

Sitting out a night was supposed to light a fire under Travis Konecny, but it seemed to inspire Joel Farabee, as well.

Farabee had the first hat trick of his career as the Flyers took a 3-1 lead late in the second period.

He scored his first two goals with blasts from the top of either faceoff circle. His third came off a deflection from a blue-line shot by Phil Myers late in the second period. He wasn’t sure if he had gotten a piece of the puck, but replays show that he did.

“I just kind of felt something hit my pants,” Farabee said. “I wasn’t sure if it was a stick or the puck. Either way, it was great.”

The uncertainty even caused Gritty to hold on to his hat, literally. The Flyers mascot threw a giant hat onto the ice when Konecny had three goals in the second game of the season. This time, he was unable to fling it because play resumed before the goal was announced.

He eventually tossed after Hayes’ game-winner. There’s a great picture of Michael Raffl wearing it.

Farabee, 20, joined Eric Lindros and Mike Richards as the only players in club history with three goals in a game before turning 21.

“You’re always working on your game and trying to find ways to improve,” said Farabee, who had four points in the opener but just one since before Sunday. “I feel really good about my game right now, and hopefully we keep moving forward.”

New York tied it with two quick ones early in the third, including Mathew Barzal on a wide-open shot from the slot on a feed from Anders Lee.

The Islanders’ rush followed a blast by Robert Hagg that missed the Islanders net and rolled around the other side of the ice. Justin Braun was unable to keep it in, and was caught flat-footed. Lee scooted past him and found Barzal.

Konecny had one shot on goal and hit the post with another attempt in nearly 16 minutes of play.

“I thought tonight was a step in the right direction,” Konecny said. “I thought I was moving my feet a little bit, a little bit more confidence.”

The Flyers killed 5 of 6 power plays, and have survived 14 of the last 15.

Brian Elliott made 33 saves, including an astounding 11 while shorthanded, to improve to 3-0 backing up Carter Hart. Elliott stopped four shots in overtime, including a point-blank chance by Scott Mayfield shortly before Hayes’ heroics.

James van Riemsdyk also had a big night, with assists on Farabee’s three goals, and a late scoring change that gave him the secondary helper on the game-winner.

Van Riemsdyk has 13 points (five goals, eight assists) and moved ahead of Jake Voracek for the team scoring lead. He made a couple of key defensive plays and hustled to nullify an icing before Farabee’s first goal. The Islanders were irate with the non-call. It doesn’t make up for Leon Stickle, but it helped.

Scott Laughton, who was the center for Farabee and JVR, did not have a point but was a plus-3 for the night. He also drew the high-sticking penalty on Barzal that Hayes converted to win the game.

The Flyers (7-2-1) next play on Wednesday when Boston, which is right behind them in the standings, visits the Wells Fargo Center.

“We have two points in four consecutive games,” said Hayes, who had four shots on goal and hit two posts. “Obviously, we need to work on things. ... I know we gave up a two-goal lead. But ultimately, we didn’t break.”

Flyers’ next five
8 p.m.
7 p.m.
at Washington
12 p.m.
Tuesday, Feb. 9
at Washington
7 p.m.
Thursday, Feb. 11
7 p.m.