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 tie-breaker, snapping the Rangers' four-game losing streak (0-1-3).
Ekman did beat Lundqvist with a penalty-shot goal in the first 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 tie-breaker.