Brennan Othmann and Maksim Tsyplakov each also had a goal and an assist, Zach Whitecloud had two assists, and Dustin Wolf made 25 saves for the Flames (11-13-2), who had lost three in a row (0-2-1)
Evgeni Malkin, Rickard Rakell and Tommy Novak each had a goal and an assist, and Arturs Silovs made 21 saves for the Penguins (7-15-2), who have lost five straight in regulation and are 2-9-1 in their past 12.
Novak put Pittsburgh ahead 1-0 at 16:20 of the first period with his team-leading ninth goal. A spinning Ben Kindel whipped a pass from the end boards to Novak for a wrist shot from the slot.
Farabee tied it 1-1, 38 seconds into the second period by tapping in a pass from Adam Klapka at the left post.
Othmann gave the Flames a 2-1 lead at 6:26. A shot from Tsyplakov went off the skate of Penguins forward Rutger McGroarty to Joel Hanley for a shot that Othmann deflected from just outside the crease.
Tsyplakov made it 3-1 at 10:37 with another tap-in near the crease set up by Zayne Parekh.
Malkin cut it to 3-2 on a power play at 14:53, taking a pass from Erik Karlsson and bouncing a backhand off the left post, and then onto and over Wolf. The forward had missed the past two games with a lower-body injury.
Ryan Strome took 21 seconds to answer, extending the Calgary lead to 4-2 at 15:14 by exchanging a few passes with Farabee before scoring with a wrist shot from the slot.
Rakell scored another power-play goal for Pittsburgh to cut it to 4-3 at 15:57 with a backhand on the rebound of Novak's shot.
Jonathan Castagna scored on a rebound off a point shot from Whitecloud, making it 5-3 at 9:18 of the third period before Yegor Sharangovich scored an empty-net goal at 17:41 for the 6-3 final.