It was the Flyers' first game since a 7-4 win at the Washington Capitals on Feb. 7. They had four games postponed because of NHL COVID-19 protocols.
Colin Blackwell and Brendan Smith scored, and Alexandar Georgiev made 20 saves for New York (5-7-3), which was 0-3-1 in its previous four games.
Artemi Panarin and Kaapo Kakko scored in the shootout for the Rangers.
Panarin had an assist in his return after missing the previous two games with a lower-body injury.
"I missed a few games and I feel better," Panarin said. "It was important for me to get a feel for the game early on and create offense. I have some things to work on, and we're going to continue working here."
Nicolas Aube-Kubel and Joel Farabee scored for Philadelphia (8-3-3). Carter Hart made 31 saves.
Sean Couturier scored for the Flyers in the shootout, but James van Riemsdyk missed the net with his attempt in the top of the third round after Panarin scored in the bottom of the second.
Philadelphia was missing six players on the NHL COVID-19 protocol list, including top-six forwards Claude Giroux, Travis Konecny, Oskar Lindblom and Jakub Voracek. It was the first time the Flyers played a game with neither Giroux nor Voracek in the lineup since March 1, 2009.
"Five-on-5, I really thought that our game was the way it had to be to give ourselves a chance to win this game," Flyers coach Alain Vigneault said. "Obviously, we had some new bodies, but we went in there and no excuses, we needed to skate hard and make the high-percentage plays, and for the most part ... I really liked our overall game."
Farabee knocked in a loose puck in the crease to tie the game 2-2 with 1:14 remaining in the third period and Hart pulled for the extra attacker.