After looking lifeless through two periods, the Rangers woke up in the third and erased a 2-0 deficit when Blair Betts scored a short-handed goal and Shanahan followed with a power-play marker less than two minutes later.
Henrik Lundqvist was perfect in the shootout, stopping Evgeni Malkin, Nils Ekman and Sidney Crosby in the tiebreaker, snapping the Rangers' four-game losing streak (0-1-3).
Ekman did beat Lundqvist with a penalty-shot goal in the first period, but couldn't repeat it. Crosby doubled Pittsburgh's lead with a power-play goal in the second, but the Penguins dropped their fourth straight.
New York had only 13 shots through two periods before breaking out with nine in the third and improved to 4-1 in shootouts this season. Lundqvist has stopped all 22 shots he's faced in the tiebreaker.
Betts cut New York's deficit in half at 8:43 of the third period when he deflected Jason Ward's fluttering shot with the shaft of his stick, netting his first goal in 13 games.
Shanahan tied it 90 seconds later, taking Jaromir Jagr's backhanded drop pass and firing a rising shot over Marc-Andre Fleury's glove for his 21st of the season.
Fleury showed that his goalie stick is good for more than just stopping pucks when he combined with Mark Recchi to set up Crosby's 12th goal of the season with 8:27 left in the second period.
The 19-year-old Crosby streaked up ice, eluded Betts and Ward, sliced between defencemen Darius Kasparaitis and Karel Rachunek before putting a shot past Lundqvist for his third power-play goal of the season.
Fleury, drafted No. 1 overall in 2003 - two years before Crosby went first - has points in consecutive starts after posting only assist in his initial 91 NHL games.
Ekman gave the Penguins a 1-0 lead with a penalty-shot goal after he was dragged down from behind by defenceman Aaron Ward, who was trying to make up for a turnover that led to the breakaway.
Ekman skated wide right on the attempt, made a short deke to the left, before shifting to his backhand for a shot inside the right post. He has six goals this season, but since a hat trick against Tampa Bay on Nov. 8 he hadn't scored any.
It was a rare 1-on-1 goal allowed by Lundqvist, who stopped Penguins forward Jordan Staal on a penalty shot earlier this season.
Notes: Rangers C Michael Nylander left after the first period because his wife went into labour. ... Staal, a rookie centre, returned to the lineup after a one-game benching. ... Kasparaitis, who has struggled to get into the Rangers lineup as he recovers from off-season operations, played his seventh NHL game this season and his first since Oct. 30. He replaced mistake-prone Sandis Ozolinsh. ... Rangers C Jarkko Immonen, recalled Wednesday from Hartford of the AHL, made his season debut. ... Penguins D Mike DuPont played his first NHL game of the season. ... Recchi has seven goals and six assists the past 13 games. ... New York was 1-for-6 on the power play. ... Pittsburgh is 0-2 in shootouts.