Pittsburgh center Evgeni Malkin returned after missing four games with a knee injury, and scored two goals to give him 10 for the season.
Penguins star Sidney Crosby assisted on both of Malkin's goals, extending his point streak to 19 games. Crosby has 20 goals and 18 assists in matching his career-long streak from Oct. 6-Nov. 17, 2007.
Claude Giroux and Nikolay Zherdev also scored for the Flyers, who have won five of six games to vault into first place in the Atlantic Division. Philadelphia also leads the NHL with 45 points.
Crosby has 62 points (26 goals, 36 assists) in 36 career games against Philadelphia.
The Penguins hadn't lost since a 3-2 overtime defeat to the New York Rangers on Nov. 15.
The mid-December meeting carried a playoff-type atmosphere for the sellout crowd of 19,824.
The Penguins came into Philadelphia as the league's second-best penalty killing team on the road, but gave up a power-play goal in the third period.
Shortly after Malkin was called for interference, Chris Pronger's wrist shot from just outside the faceoff circle was deflected by Hartnell over Marc-Andre Fleury's shoulder.
Philadelphia snapped Fleury's personal-best 11-game win streak, and the Penguins' goalie entered the game 13-0-1 in his past 14 games against the Flyers. He finished with 34 saves.
Flyers coach Peter Laviolette stayed with hot goaltender Brian Boucher, who stopped 21 of 23 shots to move to 5-0-1 in his past six games. Boucher had turned away 66 of 68 shots in wins over Toronto and Boston.
Giroux gave the Flyers a 1-0 lead at 12:32 of the first, putting a rebound from a Danny Briere shot past a sliding Fleury for his 15th goal of the season. Hartnell also had an assists on the goal. Seconds before, Fleury lost his stick behind the net.
Zherdev scored his 10th goal of the season, giving Philadelphia a 2-1 lead at 12:28 of the second. Taking a pass from James van Riemsdyk, he skated between the faceoff circles and flipped a shot past Fleury.
The Flyers, who moved to a league-best 8-1-1 in their division, beat the Penguins for the third time this season.
Malkin tied the game twice for the Penguins. His first goal came at 8:23 of the second, on a one-timer from just inside the blue line.
His second came at 3:18 in the third, on a shot from just outside the slot. Both were power-play goals.
Notes: In the most recent fan balloting results for the All-Star game, Crosby holds a commanding lead in overall votes with 410,754. ... Flyers left wing Jody Shelley served the first of a two-game suspension for a hit from behind on Boston Bruins defenseman Adam McQuaid during Saturday's game. ... Philadelphia goalie Michael Leighton was recalled from his conditioning assignment, with defenseman Ian Laperriere (concussion) moving to long-term injured reserve.