The hosts, who are battling to avoid relegation from the Iran Pro League, had taken the lead through Mostafa Seyfi before Salem Sadir equalised for the UAE side on the stroke of half-time.
The visitors then took the lead early in the second period when Iran international Mehrzad Madanchi silenced his countrymen but Mahdi Rajabzade levelled the Group D encounter before Mehdi Rajab Zadeh and Ali Samereh made the points safe in the final five minutes.
Mes had the first attempt on goal after eight minutes when Gholamaabs Ashoubi's powerful shot from outside the box brought an awkward save from Ahli keeper Mohammed Al Taweela and Faraz Fatemi could not capitalise on the follow up.
Two minutes later, Rajabzadeh received a neat pass from team-mate Abolghasem Dehnavi, but he too failed to find the back of the net.
The hosts maintained the pressure until they finally took the lead in the 19th minute when midfielder Seyfi beat three Al Ahli defenders in the box and finished from close range.
Mes were then content merely to defend their one-goal advantage and Al Ahli managed to get back into the game, equalising in first-half stoppage time when Sadir caught the home side off guard with a right-footed drive that flew past the outstretched hand of keeper Saman Safa and into the top corner.
The home side began the second period on the front foot but Dehnavi’s drive was denied by Al Ahli keeper Al Taweela in the 51st minute.
Madanchi then wasted a great chance as he could not beat Safa when one-on-one with Al Taweela but made amends in the 57th minute when he poked Bare's cross past the Mes custodian.
Fatemi failed to trouble the Al Ahli stopper with a weak header before Mes boss Luka Bonacic brought on Samereh and Rohollah Bigdeli to augment his attacking options.
The Croat's switch paid off as with 15 minutes remaining when Dehnavi raced down the touchline and his low cross was diverted into the visitors’ net by Rajabzade.
Samereh almost put Mes in front three minutes later in identical fashion but was off target.
However, the substitute did have a hand in Mes' third goal when his initial shot was blocked by a defender but Zadeh was able to lift the loose ball over Al Taweela and into the net.
And Samereh made sure of the result in stoppage time when he picked up the ball in the middle of the pitch and drove goalwards before letting fly with right-foot shot that was too good for the Al Ahli keeper.