Shanahan scored two goals and the Rangers beat the Senators 5-2 Saturday, handing the Eastern Conference champions their sixth straight loss.
With the win, the Rangers moved a game behind Ottawa for the conference lead.
"We came in here definitely catching a team down," said Shanahan. "And when a team is down you want to jump on them and you don't want to give them a chance to build confidence and build good things."
Henrik Lundqvist made 32 saves for his league-leading 14th win. Jaromir Jagr, Dan Girardi and Blair Betts also scored for New York, which took a 4-0 lead before Joe Corvo and Dany Heatley scored for Ottawa.
"I thought towards the end of the second and into the third we showed a little more energy in their zone," Senators coach John Paddock said. "We're a good hockey team that's a lot better than we're playing right now. But we're not winning lots of battles in the corners either offensively or defensively."
Girardi scored 3:37 into the game and Shanahan followed four minutes later. Jagr scored four minutes after that to put Ottawa in a 3-0 hole.
"Ottawa's having a bit of a tough stretch right now, as everybody does, and we respect that as much as anybody because we've been through that," Rangers coach Tom Renney said. "The gap's been closed by a combination of the fact that we've played better and they've been having a bit of a tough go."
- Betts' goal was into an empty net.
- Lundqvist has held opponents to two or fewer goals in 17 of 24 games this season.
- Spezza has at least one assist in his past seven games.
- Shanahan leads active players with 636 goals.