Daniel Carcillo, Martin Hanzal, and Todd Fedoruk scored for the Coyotes, who lost their season-high fifth straight game.
Mikael Tellqvist made 30 saves in his second start for the Coyotes. Martin Biron stopped 25 shots for the Flyers.
Carter pulled the Flyers into a 3-3 tie with 1:07 left in regulation when he deflected Richard's slap shot past Tellqvist. Carter's goal came after Fedoruk put the Coyotes ahead 3-2 at 14:46 of the third period when his wrist shot bounced in off Philadelphia defenseman Lasse Kukkonen.
Knuble tied it at 2 with a power-play goal at 5:08 of the third. Standing with his back to the net, Knuble deflected Kimmo Timonen's shot past Tellqvist's glove side.
Phoenix went ahead with 51 seconds left in the second period on a fluke goal that was credited to Hanzal.
Zbynek Michalek's slap shot from just inside the blue line was knocked down by Luca Sbiza, but the Flyers defenseman got tangled up with Hanzal while falling down and his stick inadvertently swept the puck between Biron's pads.
Hartnell put the Flyers ahead at 6:18 of the first period with an unassisted goal. His shot from the left circle bounced off the skate of Michalek into the net.
Carcillo tied it for the Coyotes on a power play with 1:10 left in the period. It was his first goal in 15 games, dating to April.
Hanzal prevented Biron from clearing the puck cleanly from behind the goal, and Carcillo skated in and swept it into the open net.
Notes: Phoenix C Peter Mueller played in his 100th NHL game. ... Philadelphia C Simon Gagne extended his point streak (3 goals, 7 assists) to seven games with an assist on Knuble's goal. ... Phoenix RW Brian McGrattan and C Garth Murray were healthy scratches. D Derek Morris sat out due to an upper body injury. ... Phoenix was 7-0 when leading after two periods.