The accomplished Williamson took up where he left off after 140 in the first innings to reach his 50 off 55 balls but fell to a marginal leg before wicket decision nearing tea.
The Black Caps were 142 for three off 53 overs chasing an improbable 504 runs for victory with Ross Taylor on 20 and skipper Brendan McCullum not out four when a combination of bad light and rain prevented any play after tea.
Replays showed the ball clipping the very top of the bails and the umpire's decision stood much to New Zealand's chagrin.
Williamson had looked up to the task and efficiently dissected the Australian field with his crisp strokeplay. The Australian bowlers were unable to get him to play a false stroke up until his dismissal.
Also Read
Rain twice intervened on the fourth day and there was no play after tea, meaning there will be an earlier start to tomorrow's final day's play.
Guptill was dropped before he had scored and again on seven.
Joe Burns had two fumbles at short leg to catch Guptill off Mitchell Johnson before Lyon got his fingers to a hot chance above his head at point, again off Johnson.
Fellow opener Tom Latham was dismissed in the morning session, leg before wicket to Mitchell Starc for 29.
Latham had looked assured and hooked Josh Hazlewood for six before he fell to Starc, only minutes before bad light stopped play.
New Zealand have scored the highest losing total in the fourth innings of a Test with 451 when chasing 550 against England at Christchurch in 2002.
New Zealand's highest successful run chase was 324 against Pakistan in Christchurch in 1994.
The West Indies hold the Test record for a successful run chase of 418 against Australia in Antigua in 2003.