Hayes lifted the puck past Igor Shesterkin as the Flyers got just their ninth road win in 34 games this season.
''It's always special to be back at MSG. I have a lot good memories here,? said Hayes, who played five seasons for the Rangers. ''And it's nice to get the shootout winner.''
Cam York and Owen Tippett scored early in the first period and Joel Farabee tallied 44 seconds into the third to give the Flyers a 3-0 lead before the Rangers rallied for three goals to send the game to overtime.
''We battled hard. That's a good team and they throw a lot of pucks at the net,'' Jones said. ''The guys up front played with a lot of energy. We competed hard the whole night.''
Artemi Panarin had a goal and an assist, and Mika Zibanejad and Andrew Copp also scored for the Rangers, who lost their second straight at home. Shesterkin finished with 23 saves.
''It was a good point, being down 3-0 and battling back,'' Rangers coach Gerard Gallant said. ''Their goalie played really well ... I thought we played a pretty good game overall.''
The Flyers came in 40 points behind the Rangers in the Metropolitan Division but - playing with a youth-infused lineup - managed to upend the home team. New York had won its last three games against the Flyers and had a 5-2-1 mark in the last eight meetings.
Jones made 13 saves in the first and 19 in the second before Panarin ruined his shutout bid at 1:22 of the third period with his 19th goal.
''Jones was outstanding,'' Flyers coach Mike Yeo said. ''He was playing with poise and confidence.''
Zibanejad pulled the Rangers within one with 4 1/2 minutes left with his 27th goal before Copp tied it just 12 seconds later.
''It was a really good comeback by us in the third,'' said Copp, who has points in six of seven games since he was acquired from Winnipeg on March 21. ''There's a lot of belief. We feel like we are a really good team and good teams can come back.''
The Rangers then had a power-play chance late in the third when Hayden Hodgson was assessed a tripping penalty with 3:11 remaining. Jones stopped a point-blank chance by Jonny Brodzinski with 16.6 seconds left.
The Flyers, who lost 6-3 at home against Toronto on Saturday, jumped out to a 2-0 lead on goals by York and Tippett early in the first.
York scored his third at 5:54 when his shot through traffic from the point eluded Shesterkin. Nate Thompson.
Tippett made it 2-0 at 6:44 when he rifled his seventh of the season - and first as a Flyer - past Shesterkin. Tippett was acquired from the Panthers as part of the trade which sent Claude Giroux to Florida last month. Hayes had an assist for his 15th point in his last 15 games.
''It was a good step for our team,'' Hayes said. ''I'm just trying to lead by example the best way I can. It's a demanding job. You have to show up and be consistent.''
Farabee made it 3-0 at the 44-second mark of the third with his 16th goal.
Rangers forward Filip Chytil hit the right post with a backhand with just over seven minutes left and Alexis Lafreniere had a one-timer at 19:12 that was smothered by Jones. Defenseman Jacob Trouba's fluttering shot also hit the post with six minutes left in second.
Shesterkin denied Tippett twice on breakaways in the middle period. He is 32-10-4 this season.
''The goalie of the other team played really well and we didn't win,'' Shesterkin said through a translator. ''I'm a little bit frustrated. I will keep working on my game.''
The Rangers had won five of their last seven at home and they had also won three of their last four against Philadelphia but the Flyers made the most advantage of their opportunities to come away with the victory.
The Rangers - playing their second game of a 10-game home schedule in April to finish the regular season - are still 22-7-4 at home.
YANDLE SCRATCHED AGAIN
A night after not playing against Toronto - ending his NHL-record consecutive-games streak at 989 games - Flyers defenseman Keith Yandle was a healthy scratch again on Sunday. The 35-year-old hadn't missed a game since March 22, 2009. Yandle has played for Phoenix/Arizona, the Rangers, Florida and Philadelphia. His next appearance will be career game 1,100.
NOTES: The Rangers had won the previous two meetings this season - 4-1 at home on Dec. 1 and 3-2 at Philadelphia on Jan. 15. The teams meet again April 13 in Philadelphia. ... The Rangers scratched defensemen Braden Schneider and Libor Hajek plus forwards Greg McKegg, Ryan Strome and Dryden Hunt. ... The Flyers also scratched defenseman Nick Seeler and forward Zack MacEwen.
Rangers: At New Jersey on Tuesday night.
Flyers: Host Columbus on Tuesday night.
Copyright 2022 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.