The Rangers' Mika Zibanejad celebrates after he scored a hat...

The Rangers' Mika Zibanejad celebrates after he scored a hat trick in the second period against the Sabres during an NHL game on April 25 at Madison Square Garden. Credit: AP/Elsa

The Rangers know they are going to need help to stay in the East Division playoff race. They got some earlier Sunday when the Boston Bruins lost in regulation to the Pittsburgh Penguins, and the Blueshirts took advantage.

Mika Zibanejad completed his third hat trick of the season, Kaapo Kakko had two goals and Adam Fox had three assists as the Rangers beat the Buffalo Sabres, 6-3, on Sunday night in the opener of a two-game set at Madison Square Garden.

The teams will meet again Tuesday at the Garden.

The Rangers’ second straight win moved them within four points of the Bruins (who lost their second straight on Sunday) for the division’s final playoff spot. The Rangers (25-18-6, 56 points) have seven games left in the regular season. Boston (27-14-6, 60) has nine.

Rangers coach David Quinn said he could feel before the game that his team was energized by the result of the Boston game.

"We understood that we had another opportunity to maybe climb back into this thing,’’ he said. "The Islander loss [6-1 defeat last Tuesday] I think turned into two losses, with the second one being the first Philly game [3-2 loss Thursday], and guys kind of maybe getting deflated. But we win the second Philly game [Friday] and then Boston loses [to Buffalo on Friday], and there’s hope.

"We can’t control what’s going on around the league,’’ he said. "But we’ve just got to keep taking each game as it is and keep playing meaningful hockey until someone tells us these games aren’t meaningful.’’

Zibanejad got the Rangers started early, taking a backward diagonal pass from Alexis Lafreniere and whipping a wrist shot past Buffalo goalie Dustin Tokarski from the top of the slot at 4:49 of the first period for his 17th goal.

Buffalo tied it when Jeff Skinner got to a rebound and lifted a backhand shot past Igor Shesterkin to make it 1-1 at 6:16.

But Kakko scored his first goal in 10 games at 12:02 of the period and Zibanejad made it 3-1 with a power-play goal at 17:10.

He completed the hat trick and made it 4-1 at 2:05 of the second period when he drove the middle, took a pass from Pavel Buchnevich and fired a wide-angle shot that somehow squeezed in through Tokarski. It was his seventh career hat trick (sixth with the Rangers). He is the only player in the NHL who has three hat tricks this season.

"I probably had better games than tonight where I didn’t have three goals,’’ Zibanejad said. "I mean, the puck just seemed to go in today, and when you have that feeling, you just keep shooting, obviously. And I’m playing with two great players on my line [Lafreniere and Buchnevich] and they’re finding me. And I just have to shoot and pray to God that it goes in.’’

Victor Olofsson’s power-play goal at 14:47 of the second period pulled Buffalo within 4-2, and after Kakko scored a power-play goal at 7:06 of the third to make it 5-2, Sam Reinhart scored at 10:34 to make it 5-3.

Kevin Rooney added a shorthanded empty-net goal with 54.2 seconds left.

Shesterkin made 31 saves for the Rangers.

Notes & quotes: Defenseman Jacob Trouba missed his third game since suffering an upper-body injury on Tuesday against the Islanders. According to Quinn, Trouba "keeps getting better every day,’’ but the coach could not say whether he believes he will play again this season . . . Zac Jones, the 20-year-old defenseman playing in his third NHL game, earned his first career point with the second assist on Kakko’s second goal.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 5 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME