Jakub Voracek had two goals for the Flyers (3-5-1), who have lost two straight. Claude Giroux and Wayne Simmonds scored, and goaltender Michal Neuvirth made 12 saves in relief of starter Steve Mason.
Malkin scored the winner at 8:33 of the third period. It was his 300th NHL goal.
"It feels good," Malkin said. "It's a good number. Against [Philadelphia], it's a big rivalry, very important we win tonight. Three hundred on my goal, to get us two points, is very important."
Malkin's first goal of the game put the Penguins ahead 4-2 at 9:38 of the second period, but the Flyers tied it with goals 2:12 apart later in the period.
Giroux scored a power-play goal at 13:16 to make it 4-3, and then Voracek tied it 4-4 when he scored on a penalty shot at 15:28 after being pulled down by Pittsburgh defenseman Brian Dumoulin on a breakaway.
"We didn't make very many mistakes in the second two periods," Flyers coach Dave Hakstol said. "Fifty-plus minutes where you'd say it's a blueprint of how you want our team to play. … We don't have to change anything. We have to tighten up a couple of things. Tonight, it wasn't enough. Sometimes that's the way the game is. There's no solace in it, but also there's no discouragement either."
The Penguins got three goals in 55 seconds late in the first period to take the lead. Crosby scored from the bottom of the left circle with a shot over Mason's right shoulder at 15:44 to cut the Flyers' lead to 2-1. After a penalty on Flyers defenseman Ivan Provorov, Crosby scored on a one-timer from between the hash marks at 16:27 to tie it 2-2, and then Cullen scored on a wraparound at 16:39 for the 3-2 Penguins lead.