Chasing a competitive 289 to win, New Zealand rode on a 131-run third-wicket partnership between Guptill (105) and Ross Taylor (56) to stay atop pool A with 12 points, followed by Sri Lanka (8), Australia (7) and Bangladesh (7). However after Guptill was holed out by Rubel Hossain off Shakib Al Hasan's bowling in the 31st over at 164-3, New Zealand suffered a mini-collapse to give Bangladesh a faint hope of a turnaround.
Bangladesh, who had reached the quarterfinals for the first time after beating England last Monday, are now most likely to take on defending champions India in the last eight stage after finishing fourth.
However, a final position of the pool will only be known after the Australia-Scotland match at Hobart tomorrow. If the minnows can stun the four-time champions by a big margin, the position of the teams may change.
Earlier, Mahmudullah cracked his second successive century -- a career-best unbeaten 128 -- to power Bangladesh to a competitive 288 for seven.
Defending the total, Bangladesh started off well dismissing dangerous opener and host captain Brendon McCullum (8) and first down batsman Kane Williamson (1) cheaply to reduce the Kiwis to 33-2 inside five overs.
But Guptill and Taylor added 131 runs to not only script a recovery but also lay the foundation for a successful chase.
Guptill's 100-ball innings was laced with 11 hits to the fence and two sixes, while Taylor blasted five boundaries in his 97-ball stay at Seddon park.
Nasir Hossain dismissed Taylor, while Rubel sent back Grant Elliott (39) in quick succession and then Shakib, who picked up four wickets, got rid off Luke Ronchi to further reduce the hosts to 247-6 in 44.4 overs.
However, No. 8 batsman Daniel vettori (16) smashed a six and a four in his 10-ball innings to ensure that New Zealand romp home, reaching 290-7 with seven balls to spare.
Earlier, Bangladesh rode on a brilliant innings by Mahmudullah, who starred in two crucial partnerships with Soumya Sarkar (51) and Sabbir Rahman (40) for the third and sixth wicket respectively after Kiwi skipper Brendon McCullum won the toss and elected to field.
Mahmudullah, who had become the first Bangladesh batsman to score a World Cup century during his 103-run innings against England on Monday, shared 90 runs with Soumya before adding another 78 with Sabbir
The 29-year-old cracked 12 boundaries and three sixes in his 123-ball unconquered innings at Seddon Park. Soumya had seven boundaries to show in his 58-ball stay, while Shabbir blasted five fours and two sixes in his 23-ball innings.
For New Zealand, Corey Anderson (2/43), Trent Boult (2/56) and Grant Elliott (2/27) scalped two wickets each, while Daniel vettori claimed one.
Bangladesh lost both their openers inside 10 overs with the score reading 27 for two but Mahmudullah and Soumya stemmed the rot with a 90 run partnership as the Asian nations crossed the 100-mark.
Soumya threw his wicket just after amassing his fifty when he caught by Anderson at long-on off Vettori.
Shakib Al Hasan (23) and Mahmudullah then brought up the 150 before Anderson got rid of the Bangladeshi allrounder as they slipped 151-4 in 34 overs.
Mushfiqur Rahim (15) too had a brief stay in the middle and after he was dismissed by Anderson it was Sabbir, who played the perfect cameo to raise the tempo after the 40th over.
Sabbir and Mahmudullah ensured Bangladesh accumulated 108 runs in the last 10 overs as they took the attack to the opposition, adding 78 off 48 balls, to take their team across the 250-mark.
Chasing a competitive 289 to win, New Zealand rode on a 131-run third-wicket partnership between Guptill (105) and Ross Taylor (56) to stay atop pool A with 12 points, followed by Sri Lanka (8), Australia (7) and Bangladesh (7).
However after Guptill was holed out by Rubel Hossain off Shakib Al Hasan's bowling in the 31st over at 164-3, New Zealand suffered a mini-collapse to give Bangladesh a faint hope of a turnaround.