The Boston Bruins were just 3:09 away from suffering their second loss in a row before making a thrilling comeback against the New York Islanders on Friday night.

Rookie Mason Lohrei tied the game in the final minutes, and David Pastrnak scored in the third round of the shootout to help the Eastern Conference-leading Bruins win 5-4 and improve to 19-5-4 on the campaign.

B's head coach Jim Montgomery was thrilled with his team's efforts afterwards.

“That’s the biggest win of the year,” the bench boss admitted, per The Associated Press. “Because of the attitude on the bench. It’s the first time where I felt like there was energy, emotion, everybody believed.”

Twice, Boston fell behind in the third period, and twice came back to tie the game against a surging New York team. Pastrnak, Morgan Geekie and James van Reimsdyk also scored in regulation.

“It’s a [heck] of a win for us,” Pastrnak said afterwards, per AP. “Obviously an amazing job by [Ullmark] to keep us in the game early on and then a great job by the [penalty] killers … and power play finally got some important goals.”

Ullmark was excellent in net, turning aside 34 shots in the victory.

“We were focused on the task at hand,” the Bruins' goaltender explained. “We [weren’t] complaining and talking down to each other or anything like that.”

Islanders win streak snapped

New York Islanders, Ilya Sorokin, Mathew Barzal, Bo Horvat, Brock Nelson

The victory halted a four-game winning streak for the Islanders, who themselves are surging up the Metropolitan Division standings. Now 14-7-8, the Long Island dwellers trail only their rival New York Rangers for the top spot in the division.

Isles coach Lane Lambert knew his team should have pulled out the win on Friday, but he was still happy with the effort.

“Just one of those nights where we made a couple mistakes and they ended up in the back of our net,” he explained. “But overall I thought the effort was outstanding.”

Neither of these teams will have to wait long to get back in action; the Bruins return home to host the Rangers on Saturday night, while the Islanders head to Montreal for a date with the Canadiens at the Bell Centre at the same time.