Rangers goaltender Jonathan Quick, center Mika Zibanejad and teammates celebrate...

Rangers goaltender Jonathan Quick, center Mika Zibanejad and teammates celebrate their 2-1 win against the Boston Bruins in an NHL game at Madison Square Garden on Thursday. Credit: Kathleen Malone-Van Dyke

Coming out of the Christmas break, the Rangers played well in two games in Florida but still lost both. With the season slipping away, they were desperate to get a win Thursday night.

And in their first game of the calendar year, Jonathan Quick gave one to them.

With No. 1 goalie Igor Shesterkin on injured reserve with an upper-body injury, Quick was brilliant in making 32 saves. First-period goals by the struggling Mika Zibanejad and rookie Brett Berard held up as the Rangers beat the Bruins, 2-1, at Madison Square Garden.

The Rangers (17-19-1) ended their losing streak at four games, won for only the fifth time in the last 20 games and sent their fans home happy for the first time in nearly a month.

It was the Rangers’ first home win since Dec. 6, the day they traded captain Jacob Trouba to Anaheim. Quick’s 399th career win ended a personal three-game skid.

“New year, fresh start for us,’’ said Berard, whose third goal in 15 games since his Nov. 24 call-up from AHL Hartford proved to be the game-winner. “I think it’s what we needed tonight, a big win, and go on the road and hopefully carry the momentum with us to Washington and Chicago [Saturday and Sunday]. Hopefully this is the start of a good streak.’’

Clinging to a 2-1 lead entering the third period, the Rangers held on, largely thanks to Quick, who stopped all 12 shots in the period.

“We played a great team game, especially third period there,’’ Quick said. “We did a great job keeping them to the outside, keeping them to the perimeter, getting clears when we needed and [offensive] zone time ... Yeah, just a huge two points.’’

The victory put the Rangers in a tie with the Islanders for seventh and eighth place in the Metropolitan Division at 35 points. The Rangers have played two fewer games.

The Rangers took the early lead when Zibanejad jammed in a puck that had been backhanded toward the net by Reilly Smith. The puck was trickling its way across the goal line and might have gone in on its own, but Zibanejad made sure of it at 9:48 of the first period. It was the first time in four games that the Rangers had scored first.

“It was nice just to come out and grab that energy in the building and get that lead and then try to work off of that,’’ coach Peter Laviolette said.

“Getting a lead is huge,’’ Berard said. “We’ve been falling down too many times in the last couple months or so, so to get out there and have a two-goal lead, it kind of built some confidence for the rest of the game.’’

Berard made it 2-0 when he entered the offensive zone on a two-on-one with linemate Will Cuylle and opted to shoot rather than pass. He lifted a perfectly placed wrister over the glove arm of Boston goalie Jeremy Swayman (25 saves) and into the top corner at 12:53.

“He made the right decision [to shoot],’’ Laviolette said. “They’re taking [the pass] away and he’s got that ice and he can creep in and get the look that he wants. You’ve got to take that. I mean, trying to force a pass didn’t make sense.’’

Quick went to work protecting the lead. He made a spectacular three-save sequence, stopping shots by Mark Kastelic, Justin Brazeau and John Beecher early in the second period. After he caught Beecher’s shot, Beecher and Brazeau hung their heads in frustration.

“He’s so calm and collected,’’ Smith said. “He makes three huge saves in a row, and he just goes about like as if nothing just happened. So he does a good job, kind of settling the momentum for us. And I think he did a huge job just pretty much taking a win for us tonight.’’

Boston finally got on the board when Elias Lindholm took a pretty pass from behind the goal line from David Pastrnak and lifted it over Quick’s catching glove at 7:57 of the middle period. But when Long Beach native Charlie McAvoy appeared to have an empty net to shoot at, Quick somehow was able to get his right pad out to stop his one-timer with 5:27 left in the period.

Quick didn’t make a big deal of it.

“At the time, it’s a big save,’’ he said. “But you know, it’s new shift, new guys, new challenges coming. Whether it goes in or you make a save, you move on and get ready for the next one.’’

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME