Mats Zuccarello and Derek Stepan scored for the Rangers, who have a tenuous hold on the eighth and final playoff spot in the Eastern Conference. The Rangers have 46 points, five more than the Flyers. With five games left, the Flyers have three teams to pass to get above the postseason cutoff.
Jakub Voracek added an empty-net goal in the final seconds to seal the victory for Philadelphia.
New York's Henrik Lundqvist was solid in net but two goals off the post doomed the Rangers.
Coming off a 7-3 win Monday at Montreal, the Flyers are looking to make a late playoff push. In 2010, they clinched a spot on the final game of the season and advanced to the Stanley Cup finals.
They will need more games like the last two, with Thursday's home game against the seventh-place New York Islanders up next. The Rangers, who have six games left, will host the last-place Florida Panthers on Thursday
The Flyers pounced on Lundqvist with two goals in the first period.
Schenn's eighth goal skimmed the post and went in on Lundqvist's stick side for the 1-0 lead.
With 2:39 left in the first, Gustafsson one-timed a wrist shot from high atop the circle for his third of the season.
Lundqvist, last season's Vezina Trophy winner as the NHL's top goalie, was coming off a 1-0 win against the Islanders on Saturday. Behind Lundqvist, the Rangers had been 5-1-1 in their previous seven games as they work to solidify their playoff position. The Rangers don't play another team the rest of the way that currently holds a playoff spot.
The Rangers cut the deficit to 2-1 when Zuccarello scored his first goal of the season. Though it was his first official goal, Zuccarello scored a crucial shootout goal to help the Rangers beat Toronto last week.
There would be no OT thrills in this one. Timonen banged the puck in off the post for his fifth goal and a 3-1 Philadelphia lead.
Stepan earned his team-high tying 35th point with his 15th goal.
Steve Mason, getting the spot start over Ilya Bryzgalov, made the lead stick and proved he might be worth another look down the stretch.
The Flyers snapped a three-game losing streak to the Rangers, a team they have had major trouble with the last few years. Lundqvist has 24 career wins against the Flyers, the third most of any goalie. Only Martin Brodeur (47) and John Vanbiesbrouck (26) have more.
NOTES: Fans roared when Lauren Hart, the daughter of longtime former Flyers broadcaster Gene Hart, sang "God Bless America," alternating lyrics with Kate Smith, who was on a video image. Smith's rendition of the song has been a rallying anthem for the Flyers since the mid-1970s. After a brief image of Smith, the Flyers then showed photos and video clips of rescue workers from the scene of the Boston Marathon bombings. ... The Flyers honored coach Peter Laviolette for coaching his 750th NHL game on Monday night.