Sebastian Quintana’s first half penalty, coupled with Japan’s 4-1 demolition of Vietnam in Hanoi, looked to have handed Dzemaludin Musovic’s Asian Games gold medallists the win they needed to advance.
But Al Sharjah frontman Alkas headed home just before the hour mark and Khalil tapped home from close range in added time after Ismail Matar’s long range free-kick was only parried by Mohamed Saqr to hand the UAE their first points of the group stage.
The result means Qatar are eliminated and Vietnam qualify for the quarter-finals.
Qatar coach Musovic handed Hussain Yasser an instant recall after the Al Rayyan frontman missed the draw with Vietnam through suspension as the Bosnian made four changes to his side from the draw with the co-hosts.
UAE coach Bruno Metsu was without the services of goalkeeper Majed Nasser, Basheer Saeed and Haidar Alo Ali through suspension and also made five other changes from the 3-1 defeat by defending champions Japan, which ended their hopes of progressing.
Roared on my a vocal band of Vietnamese supporters inside the Army Stadium, the UAE dominated early possession while Qatar’s Majdi Siddiq saw his rising effort from the edge of the area turned over the crossbar from Waleed Salem
Qatar danger man Quintana had a goal ruled out for offside after finding himself in space behind a high defensive line on a rare foray into opposition territory.
Metsu’s side continued to dominate as a surging Ahmed Mubarak sent a curling effort narrowly wide from just outside the area, while Alkas forced Qatar custodian Saqr into a full length diving save 12 minutes before the break after the veteran frontman had burst into the area and fired low towards the bottom corner.
Qatar grabbed what appeared to be the crucial goal three minutes before the break as Quintana beat the UAE offside trap on the right, twisted and turned inside the area to break clear of two defenders, but as the Uruguayan-striker cut in towards goal he was upended by Abdulrahman.
Quintana picked himself up and at the second attempt following encroachment from his team-mates, sent Salem the wrong way from the spot to grab his third goal of the tournament.
UAE captain Abdulraheem Juma saw his low shot across the face of goal turned away by Saqr 12 minutes into the second half as the UAE stepped up the pressure for an equaliser after the break.
Their efforts paid off a minute before the hour mark as Mubarak floated a ball into the Qatar area for Alkas to send a looping header over Saqr to send the largely Vietnamese crowd inside the Army Stadium into raptures.
A host of changes for both sides followed but Qatar failed to test Salem as the UAE defence stood firm, with Yasser’s blocked shot from the edge of the area with four minutes remaining the only real attacking threat from Musovic’s men.
Matar had only moments earlier sent a long range free-kick wide before his second speculative attempt paid off as Saqr parried the well-struck effort into the path of the onrushing Khalil, who had the simplest of task to snatch all three points with a close range header.