NEW YORK -- Nate Thompson scored the tiebreaking goal with 1:07 remaining to give the Montreal Canadiens a 2-1 win against the New York Rangers at Madison Square Garden on Friday.
Thompson scored off a pass from Nick Cousins to end a 12-game goal drought.
"We had to play a full 60 minutes and we managed to find a way," Thompson said. "I think the way we won it and the way we stuck to it the whole game, this one feels pretty good."
[WATCH: All Canadiens vs. Rangers highlights]
Brendan Gallagher scored, and Carey Price made 29 saves for Montreal (13-11-6), which won for the second time in three games following an 0-5-3 stretch. The Canadiens lost to the Colorado Avalanche 3-2 on Thursday.
"The last little while I think our compete level has been really good. I think it's been a little bit of puck luck, it's kind of not gone our way, and I think we just wanted to stick to it and I thought we did that tonight," Thompson said. "We really wanted to make sure we had a full 60-minute effort and came out and were solid, and it was a really good win for everybody tonight."
Video: MTL@NYR: Gallagher nets Danault's pass from in front
Brendan Smith scored, and Alexandar Georgiev made 31 saves for New York (14-11-3), which is 6-3-1 in its past 10 games.
"It's a tough way to lose," said Georgiev, who made 45 saves in a 3-2 win against the Columbus Blue Jackets on Thursday. "I think the guys played really well today and it's really tough that we didn't get a single point from today."
Gallagher gave the Canadiens a 1-0 lead at 10:37 of the first period on a tip-in at the right side of the net off a pass from Philip Danault. It was his third goal in the past three games.
"Obviously our goaltender was unbelievable," Gallagher said. "We stepped up in the end and scored a big goal. That's kind of what you need. Just trying to collect points. I thought it was a pretty gutsy effort."
Video: MTL@NYR: Smith uses nifty move for breakaway tally
Smith tied the game 1-1 at 2:30 of the second period when he scored on a breakaway off a turnover.
"We deserved better tonight and it's one of those things where we play again in a couple of days and just have to have a short memory and grow from it, learn from it and move on," said Rangers defenseman Marc Staal, who returned after missing 13 games with an ankle injury.
Price won his 333rd NHL game, tying him with Nikolai Khabibulin and Gump Worsley for 24th on the NHL list. Price was 1-5-1 with a 4.44 goals-against average and .849 save percentage in his prior seven starts, allowing at least five goals in four of them.
"He's a big leader for us and he's been working so hard for so many years," Danault said. "Obviously we want to play better for him. He saved our [butts] a lot of times and he was big for us tonight."
The Canadiens blew a 4-0 lead in a 6-5 loss to the Rangers on Nov. 23.
"I'm kind of at the stage now where I'm pretty good at letting those types of things go and just focusing on today," Price said. "I don't think either team was happy with the goals against the last round. So back-to-back games, guys were definitely being on the more safe side of things tonight."
They said it
"I thought we played a pretty solid road game. ... This team here has a pretty good transition game, the Rangers, and they were using it well tonight. ... Guys did what they had to do." -- Canadiens coach Claude Julien
"It [stinks]that it's just one minute left. ... It's that one bounce in the neutral zone and they go the other way and they get a couple of bounces and pass it back door and it's an empty net and they win the game. This one stings. -- Rangers forward Mika Zibanejad
Need to know
Danault, who had an assist on Gallagher's goal, has six points (two goals, four assists) in his past six games. ... Montreal was 2-for-2 on the penalty kill and has killed 15 of 16 penalties in its past six games. ... This was the fourth time Georgiev has started each game of a back-to-back set in the NHL. He's 0-3-1 in the second game. ... Price (333-234-71) is one win behind Cam Ward for 23rd place.... Montreal forward Jesperi Kotkaniemi did not play after he sustained a concussion in a 3-2 loss to the Colorado Avalanche on Thursday. ... Quinn said defenseman Libor Hajek, who sustained a knee injury in a 3-2 win against the Columbus Blue Jackets on Thursday, would be out 3-4 weeks.
Canadiens: At the Pittsburgh Penguins on Tuesday (7 p.m. ET; ATTSN-PT, RDS, TSN2, ESPN+, NHL.TV)
Rangers: At the Vegas Golden Knights on Sunday (7 p.m. ET; NHLN, TVAS, ATTN-RM, MSG, NHL.TV)
Video: Thompson pots late goal to lift Canadiens to 2-1 win