Mendis and Shanaka put on an 83-run partnership to take the game to the wire with nine runs needed off Kane Richardson's final over.
Ravindra Jadeja might be included in the series against Sri Lanka as he recovers from injury.
Australia won the fourth T20I against Sri Lanka by six wickets in Melbourne.
The India vs Sri Lanka series will begin on February 24 with the three T20Is and then end with two Tests.
Kane Richardson's three wickets helped Australia beat Sri Lanka by six wickets to take a 3-0 lead in the series.
Steve Smith suffered a concussion while attempting to take a catch in the Sydney T20I against Sri Lanka.
Australia registered a 20-run win against Sri Lanka in the 1st T20I in Sydney to go 1-0 up.
Australia's tour to New Zealand for three T20Is has been abandoned due to coronavirus threat.
Virat Kohli will play his 100th Test at the PCA Stadium in Mohali against Sri Lanka in March.
Sri Lanka were boosted by a century from Dunith Wellalage as they crushed South Africa by 65 runs.