The Islanders ran the full gamut of emotions Monday night, going from tired to resilient to jubilant to deflated to, finally, joyous.

That joy came as Mathew Barzal converted the game-winner at 1:17 into overtime to hand the Devils their first home loss of the season. Barzal was enveloped in a group hug as the Islanders celebrated a 3-2 win on the back of a red-hot Ilya Sorokin performance and sheer guile.

“Please, tell all [the] bad words about me,” Sorokin said after a 33-save performance in which he bailed out the Islanders for 60 minutes and then some. “After this, I play better.”

New York Islanders goaltender Ilya Sorokin (30) blocking New Jersey Devils center Jack Hughes (86) during a hockey game.Ilya Sorokin is pictured during the Islanders’ win over the Devils on Nov. 10. Corey Sipkin for the NY Post

Indeed, Sorokin — whose early-season struggles were the main subject of conversation around the Islanders — seems to have fully recovered.

This was his third start in four in which he was the best Islanders player. Without him, it’s hard to believe they would have had a chance of withstanding a New Jersey side that put up 25 high-danger chances.

“I thought tonight was one of those nights,” captain Anders Lee said. “You can recognize it, the way he was tracking the puck. In those flurries, he made some really athletic movements after a shot or two and tracking those rebounds down where it’s really tough. He’s battling to make those saves, and he did that.”

The Islanders will fly west for the long-haul portion of this seven-game trip that begins Thursday in Las Vegas knowing that, although they’ve still got plenty to figure out, their goalie can keep them in any game. In large part because of that, the Isles have just picked up their two best wins of the young season.

This one looked lost at least a few times, including midway through the third period, when Cal Ritchie was called for hooking and Barzal for high-sticking, one after another.

The Islanders had already let up a power-play goal barely two minutes into the game, but they found their legs on the penalty kill when it mattered and snuffed out four minutes of Devils power-play time as the game hung on edge.

Mathew Barzal scoring against the New Jersey Devils.Mathew Barzal scores in overtime during the Islanders’ Nov. 10 win over the Devils. NHLI via Getty Images

When the Islanders soon got a power play of their own, they did not let their hard work go to waste. Kyle Palmieri poked in Matthew Schaefer’s rebound to give his team a 2-1 lead with 2:57 to go.

It didn’t last.

Skating at six-on-five, the Devils needed every bit of that last 2:57 to tie the game, but tie it they did as Simon Nemec’s shot ricocheted off Simon Holmstrom and in with 4.7 seconds to go in regulation.

The Islanders’ disappointment proved temporary. Barzal won it off Jonathan Drouin’s breakaway feed just 1:17 into overtime.

“He just made a great pass,” Barzal said. “… Just perfect. Found some space in tight, tried to make something quick.”

The Islanders had not shown the best of themselves early in the night, when Timo Meier’s power-play goal gave the Devils a 1-0 edge at the 2:12 mark. Even after Bo Horvat tied it off the rush early in the second, this looked like a game the Islanders would have to steal.

Sorokin, though, kept the Islanders in it, saving them from multiple breakdowns and making a highlight-reel stop on Jack Hughes in the second period with his pad.

The Devils controlled the run of play through two periods, but just like the Islanders, lacked their usual pace and force of will.

On the ice from Long Island

Sign up for Inside the Islanders by Ethan Sears, a weekly Sports+ exclusive.

Thank you

“There wasn’t much room to be honest with you,” Drouin told The Post. “It’s always tight here. … Thought we pulled through.”

Ugly first periods, of course, do not count in the standings.

“I think that’s gonna be the team we’re gonna be this year,” Barzal said. “Games are gonna be like that. They’re not gonna be pretty. Those are the ones you gotta find a way to win. Those are how teams get in the playoffs.”