Jordan Staal, Eric Godard and Ruslan Fedotenko scored for the Penguins, who have lost four of their last five.
Philadelphia goaltender Martin Biron stopped 23 shots to improve his record to 11-6-4 as Philadelphia moved into second place in the Atlantic Division.
Dany Sabourin made 21 saves for Pittsburgh. He was playing for Marc-Andre Fleury, who has missed 13 games with a groin injury. The Flyers scored twice with a man-advantage to take a 2-0 lead after the first period.
Lupul scored on a wraparound after picking up a loose puck behind the net at 5:49.
Knuble made it 2-0 at 11:41 with a rebound of a shot from the slot by Richards.
Staal poked a backhander over Biron's shoulder to bring the Penguins within 2-1 at 7:08 of the second period. It was his 10th goal.
The Flyers then scored twice in a span of 2:29.
Richards, who also had two assists, extended his point scoring streak to seven games (6 goals, 6 assists) with his 12th goal on a wrist shot from the crease at 10:09.
Hartnell fought off a Pittsburgh defender to poke in a shot from the slot for his 10th goal at 12:38.
Knuble scored his 200th NHL goal and 12th of the season on a deflection with 2:56 left in the period. It was the 24th two-goal game of his career.
Godard scored his first goal in 99 games dating back to Oct. 13, 2007, at Nashville at 11:06 of the third period. He chipped in a pass from Peter Sykora.
Carter, who is second in the NHL in scoring, deflected Lupul's shot into the net at 15:50 for his 21st goal.
Evgeni Malkin, who leads the NHL in scoring (12 goals, 37 assists), had an assist on the play to extend his point scoring streak to six games (2 goals, 8 assists).
Fedotenko, who also had an assist, scored on a power play with 1:35 left.
Notes: Philadelphia D Carle returned after missing five games with a back/rib injury and had two assists. ... Pittsburgh D Kristopher Letang played in his 100th NHL game. ... The Penguins had allowed only one goal in their previous 13 penalty-kills before the Flyers scored two in the first period and a total of four in the game. ... The Flyers scored their three goals in the second period on only six shots. ... Pittsburgh will play its next 10 games against Eastern Conference opponents. ... The Penguins defeated the Flyers in their two previous games this season, 5-4 in a shootout, and 3-2 in overtime.