NEW YORK — Henrik Lundqvist raised his arms in a game-ending celebration as if it were playoff series clincher. It likely felt that way for the New York goalie as the Rangers snapped a brutal four-game losing streak.

Lundqvist made 28 saves in relief of Ondrej Pavelec, who injured his knee during the first period of an eventual 4-3 victory over the Calgary Flames on Friday night.

Lundqvist replaced Pavelec to start the second and made 19 saves that period then stopped all nine shots in the third to secure the win, his team’s first since Jan. 25 at San Jose before the All-Star break. It was most saves Lundqvist ever made in a relief appearance.

“We’ve been losing a lot of one-goal games, which means we are one play away, we are one save away, one goal away from getting points,” said Lundqvist, who won in relief for the third time in his 13-year career with the Rangers. “Tonight we got that goal, we got that save in the end to keep the lead.”

Mika Zibanejad scored the go-ahead goal on a power play at 12:41 of the third period off a cross-ice pass from J.T. Miller. It was Zibanejad’s 16th goal of the season.

The Rangers ended Calgary’s three-game winning streak. New York had lost 10 of its last 13 games to fall out of an Eastern Conference playoff spot.

Rangers forward Rick Nash, likely to be traded by the Feb. 26 deadline because of his expiring contract, tied it at 3 at 6:41 of the third with his 17th goal of the season. Michael Grabner and Kevin Hayes also scored.

Matthew Tkachuk put Calgary ahead 3-2 with his 18th goal of the season at 18:27 of the second on a power play. Brett Kulak had his first NHL goal, and Curtis Lazar also scored for the Flames.

The Flames (28-19-8) had won the first two games of their six-game trip, beating New Jersey 3-2 on Thursday night. Their coach Glen Gulutzan was not happy with his team’s performance especially seeing his team outshot 20-8 in the first period.

“Just the way we played and the way we approached the game. I thought we were terrible in the first and took way too many penalties,” he said. “We got what we deserved. We weren’t ready to play.”

Grabner put the Rangers ahead 2-1 at 11:52 of the second when the puck deflected off Calgary defenseman Giordano and went past goalie Mike Smith. Grabner has a team-high 22 goals.

Lazar quickly tied the contest for the Flames with his first of the season at 12:37, nudging the puck past Lundqvist when the goaltender went for a poke check attempt.

Hayes opened the scoring for the Rangers, knocking in a rebound on the power-play at 7:53 of the first period.

The Rangers (26-24-5) seemed to come out with relieved purpose a day after the organization released a letter to fans asking them to bear with a potential rebuild ahead with the league’s trade deadline looming in just over two weeks.

Vigneault said he still believes his squad can make the playoffs – though the roster he will be working with remains to be determined.

“If I were a player, I would be looking at the standings, seeing that we’re three points out of the playoffs. You can be sure I’d be coming ready, coming out and working hard,” he said. “I think that’s what we’ve been doing.”

Nash figures to be the most prominent player to depart since his contract is expiring. The 33-year-old forward needs two points to reach 800 in his NHL career. He scored a career-high 42 goals for the Rangers three seasons ago.

Even though the Rangers outshot the Flames so widely in the opening period, Calgary still managed the tie the contest at 1 when Kulak scored his first NHL goal at 18:15.

Vigneaul said Pavelec would be evaluated on Saturday and any roster decisions would be determined before the team leaves for Winnipeg and the start of a four-game trip.

With Rangers captain Ryan McDonagh out against the Flames with an upper body injury, two defensemen made their debuts for the Rangers — Neal Pionk and John Gilmour. Both were recalled from AHL Hartford.

NOTES: The Rangers have won six straight at home against Calgary . The teams meet again on March 2 in Calgary. … The Rangers also continued to be without injured defensemen Marc Staal and Kevin Shattenkirk as well as forwards Chris Kreider, Pavel Buchnevich and Jimmy Vesey . The Flames are 15-6-5 on the road.

UP NEXT:

Flames: At New York Islanders on Sunday night.

Rangers: At Winnipeg on Sunday.