Defenseman Marc Staal gave the Rangers the lead in the first period and they extended it in the second in taking a 3-2 edge in the first-round series. Game 6 is Tuesday in Philadelphia. If necessary, a deciding seventh game would be back at Madison Square Garden on Wednesday.
The teams have alternated wins the entire series.
Philadelphia's Steve Mason wasn't nearly as sharp in his second straight start following a late-season injury. He stopped 18 shots after his 37-save effort in a 2-1 victory in Game 4 got the Flyers even.
Vinny Lecavalier made it 3-1 late in the second period on the power play, and Claude Giroux scored his first of the series with 1:29 left after Mason was pulled for an extra skater.
But Moore won a race to negate an icing call and fed a pass to Brian Boyle, who scored with 15 seconds left to seal it.
The Rangers increased their pressure in tight on Mason, which was a stated goal, and created multiple scoring chances in the second period even though they managed only eight shots.
New York thought it grabbed a 2-0 lead 2:14 in when Martin St. Louis poked in a loose puck in the crease after it got behind Mason, but the play had been blown dead.
The Rangers took their two-goal lead at 8:07 of the second on Richards' second of the series and 30th career playoff score. With a crowd in front and beside Mason, Richards brought the puck out from behind the net and tucked in a backhander at the left post off assists from J.T. Miller and Carl Hagelin.
Unlike in previous games in which the Rangers allowed the Flyers to rally from 2-0 deficits, New York pushed its edge to 3-0 later in the period with a big assist from Flyers defenseman Hal Gill, playing his first game of the series.
Gill was unable to handle a rough pass at the Philadelphia blue line from defense partner Braydon Coburn. Moore swooped in to poke it behind him and skate in alone on Mason. Moore beat Mason for his second of the series and then leapt into the arms of Boyle, sending them both to the ice.
Philadelphia finally took advantage on its fifth power play when Lecavalier scored with 32.6 seconds left in the second period. Lecavalier has one goal in the series and 25 in 68 career playoff games.
The Flyers didn't muster a shot until 12:37 remained in the opening period, and finished with only eight in the frame despite two power plays. The Rangers had only six shots on Mason, but one got past him.
St. Louis raced the puck into the Philadelphia end at the center of the blue line and sent a pass to his left to Staal. His fluttering shot from above the circle appeared to hit Mason's arm before nestling into the net behind him.
It was Staal's first goal in 29 games, dating to Jan. 26 against New Jersey outdoors at Yankee Stadium.
NOTES: The Rangers put the 21-year-old Miller into the lineup in place of agitator Daniel Carcillo, who played the previous two games. It was Miller's career postseason debut. ... As expected, the 39-year-old Gill replaced defenseman Nick Grossmann, who injured his right knee in Game 4. Gill played in only six regular-season games. ... New York was 3 for 12 on the power play in the first two games, but is 0 for 11 since, including 0 for 3 Sunday.