After a goalless 90 minutes, the game went straight to penalties and Al Ahly captain Mohamed El-Shenawy saved the final spot-kick attempt from ex-Juventus midfielder Felipe Melo to seal victory.
Amr El Soleya was presented a clear chance to put Ahly ahead before the half-hour mark following a howler by Felipe Melo, but he dragged wide from close-range.
Palmeiras soon gathered their own and brought goalkeeper Mohamed El-Shenawy to work with a long-range strike by Patrick de Paula following a low pass from Luan Garcia.
The chances kept coming particularly for Ahly heading to the halftime interval, as Mohamed Magdy Afsha blazed a through ball from a tight angle by Hamdi Fathi into the side-netting.
Palmeiras emerged for the second half firing after Rony got on the end of a ball through the middle to go clear, but a goal-line clearance from Ibrahim saved Ahly’s blushes.
Egyptians giants looked for more firepower up front in the middle of the second half and introduced Mohamed Sheriff for Afsha and Junior Oluwafemi in for Walter Bwalya.
Palmeiras missed three of their five kicks, while Ahly bagged three of theirs to win the shoot-out and claim third place since 2006.
European champions Bayern Munich take on Mexico's Tigres in the final at Al Rayyan, near Doha.