BOSTON — The Islanders got a few holiday-week gifts from the Bruins early in Tuesday night’s game then Thomas Greiss fought off an onslaught, helping the Isles hang on for a 4-2 win that snapped a five-game losing streak.

The Bruins had 95 shots total for the game, 50 on net, and 39 of those (23 on goal) came in the third period. Anton Blidh and Dominic Moore scored in the first 7:12 of the third to cut a 3-0 Isles lead down to a goal and, with the home crowd springing to life, the Isles’ hideous third periods of late appeared to be a problem yet again.

“I think our mentality on the bench was a bit different tonight,” said Anders Lee, whose diving effort to swipe in a loose puck on the power play with 6:58 left provided a huge relief. “Greisser was standing tall and we played with confidence tonight.”

Despite the lopsided shot totals — they were 95-44 in attempts and 50-29 in shots on goal — the Islanders got lucky thanks to a terrible night from Tuukka Rask, who came into Tuesday having allowed only five goals in his last three starts.

Rask and Brad Marchand got their signals crossed behind the Bruins net early and Lee was the beneficiary, sweeping a loose puck into the open cage at 3:05. Thomas Hickey snapped one home on a three on one at 5:40 and the Isles were up 2-0 after a period.

Nikolay Kulemin stuffed home a harmless looking backhand at 6:18 of the second and Rask was done after three goals on 13 shots in favor of Anton Khudobin. That switch also flipped a switch for the Bruins, who pushed the pace and forced the Isles onto their heels for what seemed like the rest of the game.

advertisement | advertise on newsday

“It’s nice to get a couple bounces,” said Lee, who now leads the Isles with 12 goals, 11 of them in the last 14 games. “The puck’s been finding me, especially tonight, even in spots I don’t necessarily want it. But you take it when it comes because it doesn’t always happen.”

The Isles’ third periods have been downright terrible over their five-game skid, outscored 11-0 in that span. And Andrew Ladd’s high-sticking penalty with 31.7 seconds left in the second helped get the Bruins going in the third, when Blidh’s first NHL goal banked off Nick Leddy’s leg at 3:04 and Moore scored at 7:12.

“We knew they’d come on in the third,” Jack Capuano said. “Our goalie played big, our PK was good and we got a timely power-play goal when we really needed it.”

Capuano threw a few wrinkles into his deployment Tuesday. Dennis Seidenberg and Johnny Boychuk, the former Bruins, were paired together on defense. And John Tavares did some yeoman’s work on the penalty kill, which pitched a shutout in three Boston chances to stop a torrent of eight power-play goals against in the previous five games.

It was far from a thing of beauty. But the Islanders are well past style points, now heading into their final game before the three-day holiday break with a chance to try and inch up out of the Eastern Conference basement before the new year.

“We’re not too worried about the other teams right now, we just need points,” Josh Bailey said. “We’ll take these and move on.”