New Zealand captain Brendon McCullum made 25 runs in his final Test innings as Australia closed in on victory in Christchurch.
Resuming on 363-4, Australia reached 505 all out on day three of the second Test, a first-innings lead of 135.
In reply, New Zealand ended on 121-4 with James Pattinson taking 3-29 from 12 overs.
Kane Williamson, who finished on 45 not out, is New Zealand’s best hope of salvaging a draw.
Captain McCullum, who scored the fastest Test century in the first innings, was caught at mid-wicket by David Warner off the bowling of Josh Hazlewood.
The 34-year-old’s last Test runs came from a characteristic six, which was the 107th of his career – more than anyone else in the format.
McCullum will retire with 6,453 Test runs at an average of 38.64.
Earlier in the day, New Zealand pace-bowler Neil Wagner took the second five-wicket haul of his Test career. He finished with figures of 6-106, as Australia lost their last five wickets for 39 runs.
Australia, who lead 1-0 in the two-match series, need only draw this match to regain the number one Test ranking.
Have you added the new Top Story alerts in the BBC Sport app? Simply head to the menu in the app – and don’t forget you can also add alerts for the Six Nations, cricket scores, your football team and more.