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: Ethiopian Airlines flight to Nairobi crashes with 157 people on board
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: Mercedes look to burst Ferrari’s bubble in Melbourne
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: New Zealand calls for vaccination against measles following outbreak
- Google Is Probably Making a Video Game Console
- Odell Beckham Jr was 'a little surprised' by trade to Browns
- Scientists Say AirPods May be Linked to Cancer
- Mahatma Gandhi wanted Congress disbanded, claims PM Modi
- Fiat Chrysler to Recall 862520 US Vehicles over Excess Emissions
- Android Q Beta Ready for Pixel Phones
- Firefox Send free file transfer service now available for all
- Facebook filed a lawsuit against the Ukrainians
- Fortnite cross-play now pools players differently on consoles and mobile
- Beto Announced His 2020 Plans In A Sly Way