The wicketkeeper brushed off the knock as he went on to make 81 off 123 balls, helping the hosts set a mammoth target of 538.
Asad Shafiq will lead Pakistan in his absence, while Mohammad Rizwan took the wicketkeeping gloves.
Australia were also dealt a major blow when it was confirmed that in-form opener Khawaja suffered a meniscal tear to his left knee that is likely to require surgery.
Khawaja, who has scored a match-saving 141 in the first test, is now a doubt for the start of the home series against India, which begins in Adelaide on Dec. 6.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Australia began day four on 47 for one, trailing by 491 and facing an uphill battle to avoid defeat.
(Reporting by Hardik Vyas in Bengaluru)
