After finding themselves in yet another first-period hole, Tage Thompson and the Buffalo Sabres decided to stop digging this time.

By rallying from a 2-0 deficit in a 5-2 win over the Devils on Friday night, the Sabres also put a dent in New Jersey’s late-season playoff push.

Thompson capped a natural hat trick by scoring the go-ahead goal with 4:34 remaining and added an empty-netter, the second time he’s scored four or more goals in his career.

The Sabres bounced back from a 6-2 loss against Ottawa on Wednesday in an outing Buffalo trailed 5-0 after 20 minutes.

“Kind of get off to a similar start, down two, and it would have been easy to kind of just fold the tent and pack it in,” said Thompson, who is now tied with JJ Peterka for the team lead with 26 goals. “I thought we responded the right way. I think that says a lot about the character in the room and the guys we’ve got here.”

Peterka, with his fifth goal in four games, also scored an empty-net goal. Alex Tuch had two assists to extend his point streak to seven games (one goal, nine assists). Devon Levi stopped 28 shots.

The loss left the Devils five points behind the Washington Capitals, who hold the Eastern Conference’s eighth and final playoff spot. New Jersey lost for just the third time this season — 16-2-1 — when leading after one period.

“Just another immature performance by us,” Devils captain Nico Hischier said. “We know that was a game we should have taken advantage. I don’t think there are any excuses. I think if you look at the game, we’ve just got to find a way to win against certain teams and we haven’t done that all year. It should not happen.”

Max Willman and Jesper Bratt scored for the Devils, who blew a chance to win three straight for just the fifth time this season. Jake Allen stopped 31 shots in dropping to 4-3 since being acquired in a trade with Montreal.

Buffalo, meanwhile, stayed mathematically in the race by moving into 12th in the East, a point a ahead of Pittsburgh, and six behind the Capitals.

After scoring twice in the second period, Thompson completed his sixth-career three-or-more-goal outing by batting down Rasmus Dahlin’s shot from the left point. The puck dribbled under Allen, and Thompson used his lengthy reach to sweep the puck in behind the goalie.

“Tonight it was will and drive,” coach Don Granato said of his team’s response, before praising Thompson for lifting the team. “It’s a handful when you’re the opposition and he’s going like that.”

Thompson’s surge began after Willman’s and Bratt’s goals deflected in off Sabres players in staking the Devils to a 2-0 lead 10:31 into the first period.

Thompson responded by scoring 28 seconds into the second period off Timo Meier’s turnover in the neutral zone. He then tied it with 2:31 left into the period after being set up in the middle by Tuch, who forced John Marino to cough up the puck at the left boards.

Luke Hughes’ assist on Willman’s goal was the rookie defenseman’s 41st point of the season. He now ranks third on the team’s rookie list, one point ahead of Scott Niedermayer and one behind Viacheslav Fetisov. Will Butcher holds the record with 44 points in 2017-18.

UP NEXT

Devils: Host the Pittsburgh Penguins on Tuesday night.

Sabres: Host the Toronto Maple Leafs on Saturday night.