Malkin took a lead pass from Phil Kessel and beat goaltender Jake Allen on the backhand for his eighth of the season and fifth game-winner.
Crosby scored his fourth and fifth of the season and now has a goal against every NHL team — he had five assists in 10 career meetings against St. Louis. It was also the first time Crosby scored two regular-season goals since February, a span of 47 games.
Ben Lovejoy also scored to help the Penguins finish 3-1 during a four-game homestand after dropping three of their previous four.
Marc-Andre Fleury made 29 saves for his 11th win of the season.
Alex Pietrangelo tied the game 3-3 with 5:41 left in the third period. St. Louis also got goals from Paul Stastny and Robby Fabbri.