Asian Cup: Iraq 2 UAE 3
Iraq led 2-1 at half-time but Khalil's second goal, expertly created by Omar Abdulrahman, plus a penalty from Mabkhout saw the UAE earn their second-best finish at the continental championships.
The UAE's previous best finish was second in 1996, while Iraq were champions in 2007.
The game turned nine minutes into the second half at 2-2 when a poor pass from Iraq goalkeeper Mohammed Hameed went straight to Mabkhout on the edge of the box and, as he surged forward, Ahmad Ibrahim hauled him down from behind.
The referee was forced to point to the spot and show Ibrahim a red card, while Mabkhout converted the penalty - his fifth goal of the tournament - to give the UAE an advantage that they never relinquished.
Friday's contest appeared to offer a glimpse into the future of the Asian Cup, with both teams having impressed with youthful squads in Australia.
Iraq's starting line-up in Newcastle had an average age of 23.45, while the UAE's XI was just a year older on average.
The first genuine chance came after 11 minutes with Abdulrahman releasing Mabkhout down the right. His cross was just behind Khalil, whose volley rose high.
But the same trio combined just four minutes later to give the UAE the lead in a shining example of one-touch football.
The ball found Abdulrahman in the centre circle, who flicked it to Mabkhout for a one-two, and the UAE's chief playmaker burst forward to again deliver with his first touch, threading a pass with the outside of his left boot for Khalil to finish first time.
Iraq almost equalised in the 20th minute when skipper Younis Mahmoud pounced on a short back-pass.
Mohanad Salem's desperate sliding tackle deflected off Mahmoud onto the bar and the veteran striker's follow-up shot was acrobatically tipped away by UAE goalkeeper Khalid Essa.
But the Emiratis could not hold out as Iraq pressed, with Waleed Salem levelling the scores just before the half-hour mark, receiving possession unmarked in the box and beating Essa at his near post with a deflected shot.
Iraq hit the front three minutes before half-time, with Essa unable to hold Ahmed Yasin's blistering drive and Amjad Kalaf finishing on the rebound.
Mahmoud should have extended Iraq's lead further in the first minute after the break as he surged onto Yaser Kasim's pass, rolled the ball between his opponent's legs but blasted his shot high and wide.
The UAE made Iraq pay in the 51st minute, Abdulrahman chipping a delightful pass over the top to Khalil, who timed his run perfectly before rounding Hameed to score.
Ibrahim's red card followed four minutes later and Mabkhout struck for the fifth time in the tournament, converting calmly from the spot.
That goal saw Mabkhout move ahead of team-mate Khalil and Jordan's Hamza Al Dardour to earn the Asian Cup's golden boot award, although Australia's Tim Cahill (three goals) could still get involved in the final calculations during Saturday's final versus South Korea.