Mahlambi left Bidvest Wits to join the eight-time CAF Champions League winners in 2017 but was unable to stake a claim for a regular starting berth.
The forward, who already won the Absa Premiership during his time with the Clever Boys has penned a lucrative five-year deal with Masandawana and will add to the plethora of attacking options manager Pitso Mosimane has at his disposal.
The 20-year-old made 15 appearances for Al Ahly, scoring one goal and assisting a further five.
The club tweeted,"Let's Welcome Phakamani to the Yellow Family Masandawana!"
Mahlambi scored 10 goals and registered as many assists in 27 league games before his sensational transfer to the 40-time Egyptian champions.