It looked like being a painful night for the Socceroos at the Grand Hamad Stadium after Iraq substitute Ala'a Abdulzehra finished off a counter-attack by slotting home in the 72nd minute.
However, with 10 minutes to go, man of the match Cahill climbed high from a Matt McKay corner to produce a trademark header to level the scores.
The sighs of relief in the Australian camp turned to jubilation four minutes later when substitute Tommy Oar produced an inviting ball for fellow replacement Thompson to nod home in front of a crowd of 2183.
With Oman doing Australia a favour by defeating Jordan 2-1, the Socceroos now sit in second place in their group on goal difference with four matches to play next year.
Those remaining games include home fixtures against Oman, Jordan and Iraq and a tricky away match against frontrunners Japan.
The top two sides qualify for Brazil in 2014 with the third-placed team forced to defeat another Asian team and the fifth-placed South American team to progress.
Australia will be without skipper Lucas Neill and midfielder Carl Valeri for their next qualifier against Oman on March 26 in Sydney after both picked up yellow cards on the night.
Socceroos coach Holger Osieck was delighted with his team's comeback.
"I think we are back in the race ... it is better to operate from the upper position rather than to chase the pack," he said.
In sapping conditions, Osieck's decision to hold off until the 75th minute to make his first substitution looked like backfiring when Australia went 1-0 down.
However, Thompson made an impact in his quarter of an hour on the pitch, netting his third goal in three outings for Australia off a perfectly-weighted ball from Oar.
"I wanted to substitute at that very moment when they had the counter (and scored) because I had the feeling we needed some fresh legs," Osieck said.
"Unfortunately we conceded but our substitutes gave us more energy and freshness and it was nice that we could benefit from both."
In an encouraging sign, youngster Robbie Kruse bamboozled the Iraq defence in a fine performance as he continued to cement his spot in the national team.
Makeshift defender McKay was one of Australia's leading players while Cahill was at his combative best and should have had his first goal in the 19th minute but scuffed his shot.
Not that he was the only Australian guilty of missing opportunities.
Kruse missed a sitter in the 56th minute as the Socceroos dominated the contest.
Midfielder Mark Bresciano, who only lasted an hour in total in the previous two qualifiers, was not needed with Osieck making three changes to the starting side that lost 2-1 to Jordan last month.
There was a nervous moment for Neill in the 57th minute when he was judged to have pulled back Younus Mahmood.
The Iraq striker looked to be sprinting clear of Neill onto a long ball when the skipper stopped his progress.
Neill received a yellow card but was possibly a touch fortunate not to be handed a straight red from referee Lee Min Hu for being the last defender.