New Zealand moved to the brink of the World Cup semifinals with a thrilling five-run victory over West Indies on Saturday after Carlos Brathwaite's magnificent century almost produced a highly unlikely comeback win for the Caribbean side. Chasing 292, after skipper Kane Williamson's fine 148 for New Zealand, West Indies were well poised at 130 for two after 20 overs but never recovered from the loss of Shimron Hetmyer (54) and Chris Gayle, who made 87 including six sixes. West Indies collapsed to 164 for seven and looked out of the game until Brathwaite led a rearguard action, bringing back memories of his sensational performance in the 2016 World Twenty20 final. Brathwaite's power-hitting, including nine fours and five sixes and a 41-run 24-ball last-wicket partnership with Oshane Thomas who did not score, put West Indies within five runs of victory. But on the final ball of the penultimate over, Brathwaite went for the big hit, only for his drive off Jimmy Neesham to find Trent Boult's hands at deep mid-on and the West Indies batsman collapsed to his knees. The win moved unbeaten New Zealand to the top of the table with 11 points and left West Indies staring at likely elimination in seventh place with three points. New Zealand finally saw the back of Gayle after dropping the big-hitting West Indies batsman three times in a World Cup match on Saturday. The veteran opener led West Indies' charge with a typically dashing 87 off just 84 balls. But he eventually holed out as part of a collapse that saw five wickets lost for 22 run in 28 balls as the West Indies slumped to 164 for seven. Evin Lewis was unable to partner Gayle at the top of the order after being off the field for most of the New Zealand innings with a hamstring injury. Stand-in opener Shai Hope played on to Trent Boult for just one. Left-hander Gayle was first dropped on 15 when Boult failed to hold a desperately difficult chance as the ball dropped over his shoulder. Gayle responded by hitting the next two balls for six. He was dropped again on 58 when Matt Henry floored a routine chance at deep square leg off Mitchell Santner, with the spinner again denied Gayle's wicket in the same over when Colin Munro could not cling on at deep midwicket. Shimron Hetmyer, also going for his shots, made a brisk fifty before he was bowled by a slower ball from Lockie Ferguson, who then struck next ball to have West Indies captain Jason Holder caught behind. Gayle's luck ran out when he hoisted Colin de Grandhomme to the long-on boundary where Boult held a safe catch. Earlier, Kane Williamson's latest batting masterclass helped New Zealand recover from a woeful start to post a competitive 291-8. New Zealand were 7-2 inside the first over after fast bowler Sheldon Cottrell removed openers Martin Guptill and Munro for golden ducks. But New Zealand captain Williamson's career-best 148 — his second successive World Cup hundred after a match-winning 106 not out against South Africa at Edgbaston on Wednesday — turned the tide. Williamson received sound support from Ross Taylor (69) during a third-wicket stand of 160. Cottrell, however, left the West Indies with a reachable target thanks to his 4-56 in a maximum 10 overs, including the key wicket of Williamson. Taylor gave his innings away when he could not clear Holder at mid-off after chipping a catch off Gayle. But Williamson carried on in typically calm fashion. He went to his 13th One-Day International hundred with his eighth four when he pulled a loose ball from fast bowler Kemar Roach. He then hoisted Cottrell legside for the only six of his innings. Williamson surpassed his previous best score in 137 ODI innings — 145 against South Africa in Kimberley in 2013 — before he fell skying Cottrell to wicket-keeper Hope. In all, Williamson faced 154 balls, including 14 fours and one six. He has now scored 373 runs, including two hundreds, in four innings this World Cup at an average of 186.5. Scoreboard New Zealand M. Guptill lbw b Cottrell 0 C. Munro b Cottrell 0 K. Williamson c Hope b Cottrell 148 R. Taylor c Holder b Gayle 69 T. Latham c and b Cottrell 12 J. Neesham c Cottrell b Brathwaite 28 C. De Grandhomme run out (Cottrell) 16 M. Santner c Cottrell b Brathwaite 10 M. Henry not out 0 Extras (lb4, nb1, w3) 8 Total (eight wickets, 50 overs) 291 Did not bat: Lockie Ferguson, Trent Boult Fall of wickets: 1-0 (Guptill), 2-7 (Munro), 3-167 (Taylor), 4-210 (Latham), 5-251 (Williamson), 6-270 (De Grandhomme), 7-291 (Santner), 8-291 (Neesham) Bowling: Cottrell 10-1-56-4 (1w), Roach 10-2-38-0, Holder 7-0-42-0, Thomas 6-0-30-0, Brathwaite 6-0-58-2 (1w), Nurse 9-0-55-0, Gayle 2-0-8-1 (1w). West Indies C. Gayle c Boult b De Grandhomme 87 S. Hope b Boult 1 N. Pooran c Latham b Boult 1 S. Hetmyer b Ferguson 54 J. Holder c Latham b Ferguson 0 C. Brathwaite c Boult b Neesham 101 A. Nurse c Latham b Boult 1 E. Lewis c Neesham b Boult 0 K. Roach c Latham b Henry 14 S. Cottrell b Ferguson 15 O. Thomas not out 0 Extras (lb3, w9) 12 Total (all out, 49 overs) 286 Fall of wickets: 1-3 (Hope), 2-20 (Pooran), 3-142 (Hetmyer), 4-142 (Holder), 5-152 (Gayle), 6-163 (Nurse), 7-164 (Lewis), 8-211 (Roach), 9-245 (Cottrell), 10-286 (Brathwaite) Bowling: Boult 10-1-30-4 (1w), Henry 9-0-76-1 (2w), Ferguson 10-0-59-3 (2w), Neesham 6-0-35-1, Santner 10-1-61-0, De Grandhomme 4-0-22-1.