Australia looked in complete control at tea on 431 for five, but they then collapsed to be all out for 467 within nine overs of the restart.
Skipper Paine departed for 79 seven balls after tea, with Mitchell Starc gone soon after for one. Head, Cummins and Nathan Lyon rapidly followed with Neil Wagner (4-83) and Tim Southee (3-103) doing the damage.
Australia started the day at 257 for four with Steve Smith on 77 and Head not out 25.
Head came into the match under pressure after a lean spell, but silenced his critics with only his second Test century, reaching three figures off 222 balls.
“It’s very nice to contribute. It’s pretty cool to score a Boxing Day hundred, nice to get my opportunity,” said Head, adding that Paine counter-attacking when he came in helped.
“It helped that Tim came out and struck the ball as well as he did, it definitely took a lot of pressure off me. But credit to New Zealand, at times it was difficult and they stemmed the scoreboard.”
‘We kept fighting’
It was a patient innings from the 25-year-old, who scored his only other century (161) against Sri Lanka in Canberra. After reaching his ton he began hitting out and finally fell to a Wagner full toss, slicing it to Mitchell Santner.
He was ably supported by the impressive Paine, who played an array of shots to notch his seventh Test half-century off just 72 balls. The 35-year-old had a golden opportunity to score a maiden ton, but he blew it, out lbw to Wagner after a review.
That brought Starc to the crease, but he lasted just three balls before spooning a Southee delivery to Williamson at mid-off.
Cummins and Lyon managed just one run between them with Pattinson left not out 14.
“I thought we kept fighting, kept trying and that is one of the great characteristics about this team, we keep giving everything,” said Wagner.
“A tough day, but full credit to the Australian batsmen. It’s almost like they’ve been a step ahead of us, they showed a lot of patience and clear plans.”
It was a big turnaround for New Zealand who were buoyed after snaring the vital wicket of Smith for 85 before lunch, but then failed to capitalise.
Smith looked set for a 27th Test century and his fifth in as many Tests at the Melbourne Cricket Ground before a Wagner bouncer ended his 242-ball knock.
It had been slow going as pace spearheads Trent Boult, Southee and Wagner kept the batsmen in check, with Smith adding just eight to his overnight score in more than an hour before he was out.
Wagner had been peppering him with short balls and one ballooned off Smith’s bat handle and glove with Henry Nicholls taking a fine one-handed catch at gully.
While deprived of another ton, it marked a return to form for a player who, uncharacteristically, had gone five innings without a 50.
New Zealand are playing their first Boxing Day Test in Melbourne since 1987, with Williamson winning the toss and opting to bowl. Nearly 60,000 turned up to watch on Friday after more than 80,000 on day one.