Quick Mohammed Shami picked up a career-best 6-56 as the hosts lost six wickets for 51 runs before a 36-run last-wicket partnership between Mitchell Starc (14) and Josh Hazlewood (17 not out) boosted their tally.
Usman Khawaja top-scored for Australia with 72, while Aaron Finch (25) was dismissed first ball by Shami on resumption of his innings after retiring hurt on day three.