UAE, who already entered the game knowing they have no hopes of qualifying to the quarter-finals, handed co-hosts Vietnam a priceless favor as the latter were thrashed 4-1 by Japan.
Japan finished top with seven points, Vietnam come second on four points, while Arab duo UAE and Qatar crash out with three and two points respectively.
At the Army Stadium, Qatar finished the first half in front thanks to a 42nd minute penalty from Uruguayan-born striker Sebastian Quintana, who should have been sent off earlier for cruelly throwing the ball against the linesman.
In the second half, UAE equalized at the half-hour through Saied Al-Kas, before Faisal Khalil stunned the Qatari team with the winner in injury time.
In the other game, Japan came back from a goal down as well, as Keita Suzuki's own goal put Vietnam ahead early on.
However, Japan made a thrashing comeback, with goals from Seiichiro Maki (twice), Yasuhito Endo and Shunsuke Nakamura.