UAE coach Alberto Zaccheroni had predicted fine margins would settle the tournament, and that too proved to be the case in Group A's opener.
With Mohamed Al Rohaimi having put Bahrain ahead in the 78th minute, Zaccheroni turned to Khalil from the bench and his faith paid off as the striker lashed in the equaliser from 12 yards.
UAE could have been ahead early on had Ismail Al Hamadi kept his cool when one-on-one with Sayed Shubbar Alawi, while Komail Alaswad went close with a dipping free-kick at the other end.
Khalid Eissa Bilal's failure to hold Ali Jaafar Madan's shot almost proved costly for the hosts after the restart, but he recovered to deny Al Rohaimi on the rebound before UAE's Ali Ahmed Mabkhout drilled wide of an open goal.
Al Rohaimi did better with his next chance, hammering home at the second attempt after Khalifa Ghanim's goal-line block, but UAE did not accept defeat.
Just after coming on as a substitute, Mohamed Marhoon was harshly penalised for handball, and Khalil, who now needs two goals to equal Adnan Al Talyani's record of 52 for UAE, made no mistake from the spot.
Zaccheroni must now rally his side for a crucial match with India, while Bahrain faces Thailand on Thursday.