Ahmad scored the decisive goal in the 83rd minute when he converted from the spot a Farzad Hoeesinkhani own goal had given the hosts a first-half lead.
Mahdi Rajabzadeh had equalised for Mes in the 74th minute with a close-range finish before Ahmad Khalil's late intervention.
Mes shot twice over the bar in the opening six minutes as the game began at a slow pace
Al Ahli keeper Abdulla Yousif made a good save to deny Edinho (Eder Luciano) in the 10th minute before Faisal Khalil tested Mes goalie Saman Safa with an angled shot from the right side following a driving run eight minutes later.
Ahmad Khalil saw Safa fail to collect his 30-yard free-kick but Faisal Khalil squandered the rebound before the deadlock was broken in unfortunate circumstances for the visitors when Hoeesinkhani deflected the ball into the Mes net.
Five minutes later, Abdrabou Hosni’s free-kick from just outside the area skimmed the top of the bar as Al Ahli went in at the break one goal to the good.
Mes showed a renewed sense of urgency after the interval and while Al Ahli were content to sit on their one-goal lead, the Iranians pressed for an equaliser.
Edinho came close with a long-range shot which landed on the roof of the net in the 54th minute and Rohollah Bigdeli fired over the crossbar eight minutes later.
Ahmad Khalil then missed a golden opportunity in the 71st minute after being released by a sublime pass from Farej Khamis but he rifled wide of the left post.
Rajabzadeh, who scored a brace in Mes' 4-2 win over the same opponents in Iran, then squared the contest three minutes later with a close-range finish from Milad Fakhroddin's cross, with the substitute managing to deliver into the box despite slipping at the same time.
However, Al Ahli were not to be denied as Saad Surour was brought down in the box seven minutes from the end as he tried to weave his way through a horde of defenders.
Ahmad Khalil made no mistake with the resultant penalty, finding the top left corner and sending Safa the wrong way to upset the visitors and seal the UAE side's first win of their 2010 campaign.