Ahly midfielder Amr El-Sulaya fights for the ball during the match with Raja on Saturday 16 April, 2022. Photo courtesy of Ahly's Facebook page.
Raja keeper Anas Zniti produced a string of impressive saves to keep his side in the tie, with Ahly at times looking capable of securing a comprehensive win.
Ahly took an early lead via a controversial penalty from midfielder Amr El-Sulaya before winger Hussein El-Shahat, who made a rare start, doubled their advantage midway through the first half.
They were punished for their profligacy though when Raja's lively midfielder Mohamed Zrida pulled one back on the stroke of halftime, netting from the team's first real effort.
Raja, apparently aware that their high pressing strategy backfired in the first half, took a more cautious approach in the second period but their sloppy defending cost them once again when defender Marouane Hadhoudi received a straight red card for blocking a goal-bound shot with his arm.
However, it was not meant to be this time around as Zniti blocked El-Sulaya's spot-kick and Raja then survived a barrage of Ahly attacks to keep alive their hopes of reaching the last four when the second leg takes place in Casablanca on Friday.
Ahly were awarded a dubious penalty when a left-wing cross appeared to have struck the flailing arm of midfielder Mohamed Al Makahasi after 13 minutes, with Congolese referee Jean Jacques Ndala pointing to the spot after watching a video replay.
However, further replays, which were only shown after Ndala had already made up his mind and gave Ahly the penalty, showed the ball bouncing off Al Makahasi's knee before hitting his arm.
El-Sulaya's effort down the left went past Zniti, who guessed the right way but could not keep it out.
Ahly continued to expose Raja's defensive gaps after going ahead, with Zniti in inspired form.
He blocked a free diving header from striker Mohamed Sherif and thwarted South African forward Percy Tau in a one-on-one. In between, a deflected shot from talented winger Ahmed Abdel-Kader went just wide after he turned Abdelilah Madkour inside out.
Ahly deservedly scored on 23 minutes when El-Shahat held off his challenger to pop up in the six-yard box and side-foot home an inviting low cross from Tau.
They could have gone 3-0 up in the 39th minute but El-Sulaya's header from a corner was cleared off the line by Zrida.
Zrida then punished Ahly at the other end as he caught Ahly's retreating defence napping to connect with a pull-back from Madkour and fire a low shot under keeper Mohamed El-Shennawi.
Raja had to play most of the second half with ten men following Hadhoudi's 59th-minute dismissal, with Ahly mounting a relentless onslaught.
Tau turned past his marker but shot over the crossbar when well-positioned to score after a threaded pass from the in-form Abde-Kader, who also had a header palmed away by Zniti.
In stoppage time, substitute Taher Mohamed Taher struck the outside of the post with a snap shot from a tight angle, with Raja breathing a sigh of relief after the final whistle was blown.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)