Brad Richards and Chris Kreider also scored for New York, which has won 11 of the last 12 meetings with Philadelphia. Rangers coach John Tortorella became the 30th coach in NHL history to reach 400 wins, and his team maintained its hold on the eighth and final playoff spot in the Eastern Conference standings.
Wayne Simmonds and Jakub Voracek scored for Philadelphia, which lost for the third time in four games against New York this season and fell further out of the playoff race. The Flyers began the day in 13th place, five points behind the Rangers.
New York went ahead 3-0 with just more than 14 minutes left in the second period when Stepan scored on a backhander. Nash dumped the puck toward the net and found a wide-open Stepan, who deked Ilya Bryzgalov and had an empty net in front of him.
Just 2 1/2 minutes earlier, Richards beat Bryzgalov high to the glove side on a one-timer from the point on the power play, giving the Rangers a 2-0 advantage.
Philadelphia netted its first goal with 2:07 left in the second period when Simmonds scored from close range on the power play to pull the Flyers to 3-1. Voracek's initial shot from the point went off the post and to Claude Giroux, who redirected it in front of the crease to Simmonds.
Then the Flyers closed to 3-2 at 7:28 of the final period when Voracek scored on a deflection in front of Rangers goalie Henrik Lundqvist. Bruno Gervais won the faceoff back to Giroux, who one-timed it off Voracek and past Lundqvist, who finished with 32 saves.
But the Rangers answered just more than two minutes later when Nash scored his second of the night on a wraparound. Assists went to Carl Hagelin and Stepan, pushing New York's lead back to two goals.
The Rangers struck first with 5:06 remaining in the opening period when Nash's wrister from the slot beat Bryzgalov high on the stick side.
Islanders 3, Capitals 2
WASHINGTON (AP) -- John Tavares broke a tie with 5:18 left to help the New York Islanders beat the Washington Capitals 3-2 on Tuesday night.
Matt Moulson forced a turnover by Washington defenseman Mike Green next to the Capitals' net and fed Tavares in the right circle for his 20th goal of the season. Michael Grabner and Josh Bailey also scored for the Islanders.
Mike Ribeiro and John Carlson scored for Washington.
New York (15-15-3) and Washington (15-17-1) are fighting for playoff spots in the Eastern Conference. The Islanders have won two straight and improved to 9-4-1 on the road. They also ended Washington's winning streak at three games.
New York's Evgeni Nabokov made 20 saves to improve to 12-1-2 lifetime against Washington.
Lightning 2, Sabres 1
TAMPA, Fla. (AP) -- Steven Stamkos and Martin St. Louis each had a goal and an assist and the Tampa Bay Lightning defeated the Buffalo Sabres 2-1 on Tuesday.
Stamkos scored his league-leading 23rd goal of the season off a deflection past Ryan Miller at 16:01 of the first period.
St. Louis extended the lead to 2-0 at 8:15 of the second period with a power-play goal off a sharp pass from Teddy Purcell.
The Lightning ended a three-game losing streak while Buffalo failed to make up ground in the race for the final playoff spot in the Eastern Conference.
Jordan Leopold scored for Buffalo at 16:52 of the third period.