On a sunny day, there's no denying the Basin Reserve's charm, with the embankments filled up, kids running around with bats and balls, the smell of coffee… The fans are friendly and politely interested when the visiting team is doing well, visibly enjoying good cricket and asking plenty of questions about the new guys. But when the home team is doing well, the atmosphere turns to euphoria.

And so it was on Monday. A large crowd had built up by the time New Zealand and Kane Williamson got close to their landmarks. There were slow claps as Williamson steadied himself to face up in the 217-run chase. And loud groans if he missed out on runs.

Amid the steady build-up in excitement, Williamson got to his hundred with a swept four before picking up the single that sealed victory, the result of a fightback that began mid-third day. Tom Latham's 177 got things rolling, ensuring they got as close as possible to Bangladesh's huge first-innings total and it was that effort that made all the difference, according to Williamson.

"To even get close was a huge effort, from then on it became a second-innings match," he said. "On the back of a fantastic knock by Tommy Latham, there were a lot of partnerships throughout which we felt were very important. We felt we just had to get as close as we could to their score.

"We knew the wicket was still good but if we are able to put them under pressure late in the day and take a few wickets, it might help our cause. The [bowlers] stepped up after the first innings. They showed lot of energy, put the ball in right area."

After struggling to contain Shakib Al Hasan and Mushfiqur Rahim in the first innings, as the pair went about putting together a record-breaking 359-run stand, the group of Trent Boult, Tim Southee, Neil Wagner and Mitchell Santner broke Bangladesh's back on the fourth evening before patiently waiting for them to make mistakes on the fifth morning.

Shakib threw away his wicket early in the day, before Mominul Haque chased away from his body to edge to gully. After Mushfiqur Rahim was knocked out of the contest, Sabbir Rahman tried to work around with the tail but he, too, was out chasing a wide one that he could have left alone. The New Zealand bowlers did well to continuously create doubt in the minds of the Bangladesh batsmen, resulting in a flustered approach on a day that demanded they remained calm.

Williamson praised his bowlers for returning with such a fine performance. "The way our bowlers came back after a really tough first innings and bowled with energy and put the ball in right area was a great effort, which set the game up for us."

The target was not daunting and New Zealand had time to get there, but Williamson still needed to guide the chase to its ending after they lost both openers cheaply. In the company of the experienced Ross Taylor, he did.

"Coming into the last two sessions, either team could have won it," Williamson said. "We needed to knuckle down, get a partnership together and get bit of momentum. When you are 2 for 30-odd, 200 can be quite long way away in the last innings. It was nice to be able to get that momentum."

Both teams will move to Christchurch on Tuesday for the next Test. Despite the result, Bangladesh will take plenty of positives from this game. New Zealand, however, will definitely be the team in the better frame of mind.

Mohammad Isam is ESPNcricinfo's Bangladesh correspondent. @isam84