NEW YORK (AP) -- Nathan MacKinnon scored the tying goal in the third period and then connected in the shootout as the Colorado Avalanche rallied for a 4-3 victory over the New York Rangers on Thursday night.

Alex Tanguay of the Colorado Avalanche scores the game winning goal in the shootout at Madison Square Garden in New York City. (Bruce Bennett, Getty Images)

MacKinnon started the tiebreaker with a goal, and Alex Tanguay added one in the third round. Semyon Varlamov stopped Mats Zuccarello and then Lee Stempniak on the final attempt as Colorado won for the first time in three games on a four-game trip.

MacKinnon got the Avalanche even at 3 when his shot during a power play deflected off defenseman Dan Girardi's stick and past Henrik Lundqvist at 7:54 for his fifth goal.

Matt Duchene had a goal and assist, and Tanguay also scored for the Avalanche, who had dropped four of five. Varlamov stopped 30 shots.

Derek Stepan and Girardi scored their first goals of the season 1:43 apart in the second period for the Rangers, who led 3-2 after trailing by a goal twice. Kevin Hayes also scored in the middle frame, and Henrik Lundqvist made 25 saves.

(Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)