With BJ Watling falling shortly after, New Zealand declared on 432/6, which gave them a 221-run lead.
Wagner finished with four for 28 while Boult's late burst gave him three for 38.
It didn't stop him from reaching 50 for the 50th time in test cricket, but once he was dismissed for 74 by spinner Taijul Islam, Williamson headed to a radiology clinic for some precautionary scans, returning in time to see Ross Taylor and Henry Nicholls bring up milestones after tea. Taking risks, he was twice dropped on 20 in the same over from Ebadot Hossain, first at cover by captain Mahmudullah, then at slip by Shadman Islam.More news: Fiat Chrysler to Recall 862520 US Vehicles over Excess Emissions
It came on a fourth day when the hosts completely dominated Bangladesh in the second Test to close in on a series win.
"If things progress as we hope, then still going to the IPL shouldn't be a problem to him", said Stead.
"I thought they bowled really well those first six or seven overs and Kane and I were jumping around a bit".More news: Facebook Facing Criminal Investigation Into Device Data Share Deals
In doing so, Williamson joined Taylor atop the New Zealand batting list with 30 half centuries in tests but only minutes later Taylor moved to 31 with a half century from 61 balls.
Taylor went on to his 18th century from 97 balls, an astonishing strike rate in hard conditions.
Three of the dismissals, including the key scalp of Tamim Iqbal for 74, came in a sharp 13-ball spell from Wagner either side of lunch.
Tamim and Mominul Haque (15) added 44 for the second wicket to have Bangladesh 119 for one before Wagner's short-ball specials took effect and five wickets fell for 49 runs. Tamim hit the first ball for four; Boult smiled ruefully, then produced an nearly unplayable delivery which swung, then seamed back to bowl Iqbal.More news: Scientists Say AirPods May be Linked to Cancer
- An Eye Doctor may help diagnose Alzheimer’s before its symptoms
- Oil Prices Spike As EIA Confirms Inventory Draw
- China's dissent on Azhar counters mutual goals
- Google Is Probably Making a Video Game Console
- Fortnite cross-play now pools players differently on consoles and mobile
- Mercedes look to burst Ferrari’s bubble in Melbourne
- Spotify Hits Apple With Antitrust Complaint in Europe Over App Store
- Ethiopian Airlines crash: Six charts on what we know so far
- New Zealand calls for vaccination against measles following outbreak
- Android Q Beta Ready for Pixel Phones