Middle order batters Daryl Mitchell (42) and Tom Blundell (47) fell short of half-centuries but New Zealand still ended day three on a commanding 440-6 and optimistic of a handy lead.
Williamson was batting on 105, his 25th test hundred, with Ish Sodhi on one at the other end.
Earlier, Devon Conway fell for 92 but Tom Latham could not be denied his century after New Zealand resumed on 165 for no loss at the National Stadium.
Nauman Ali spun one past the bat and into Conway’s pad to remove the opener who was initially ruled not out but had to go after Pakistan reviewed the decision by umpire Aleem Dar.
Latham took a single off Abrar Ahmed to bring up his 13th Test hundred, the most by a New Zealand opener, in his 69th match.
Latham used his feet against the spinners and looked confident until an attempted reverse sweep against Abrar brought his downfall.
Latham managed to glove the ball which ballooned behind the wicketkeeper and the slip fielder had plenty of time to move across and pouch it.
Henry Nicholls (22) dragged a Nauman delivery onto his stumps but Mitchell’s arrival provided no respite for Pakistan’s tiring attack.
Mitchell reverse swept the second ball he faced, from Nauman, for a four and in the spinner’s next over hit him for a six.
Mohammad Wasim was treated with equal disdain with Mitchell hitting the seamer for four successive fours.
Mitchell’s entertaining knock was cut short when he fluffed his reverse sweep against Abrar.
Williamson got an lbw decision against him overturned and survived a stumping opportunity before reaching his hundred with a single off Wasim.
While their bowling lacked firepower, Pakistan’s fielding was sloppy too, which was best illustrated when Imam-ul-Haq and Abrar ran chasing a skier from Blundell only for both to pull out at the last moment.