The right-handed opener was out for 102 as he top scored in a New Zealand innings which left Sri Lanka with a challenging target at the beach resort town.
Kane Williamson and Ross Taylor both made 61 while Luke Ronchi was not out 37.
Williamson, again leading New Zealand with Brendon McCullum still sidelined by a back injury, had looked in good touch until he was undone by a poor ball from Tillakaratne Dilshan going down the leg side.
Guptill was also dismissed by a poor shot when he lobbed Nuwan Kulasekara, Sri Lanka's most successful bowler, straight to Thisara Perera at long on.
More From This Section
New Zealand were 206 for 3 after 38 overs when Guptill was removed and added 82 off the last 10 overs.
Guptill had been out of form when New Zealand toured Australia in November but has found his touch since returning home.
His 102, which included nine fours and three sixes off 109 deliveries, elevated him into an elite group with Nathan Astle and Taylor as the only New Zealanders to score 10 or more ODI centuries.
New Zealand won the Test series 2-0 and lead the ODI series 2-1 with one match washed out.
Sri Lanka, looking to square the series, won the toss and put New Zealand into bat with immediate success when Tom Latham was out in the first over without scoring.
But Guptill and Williamson then put on 122 for the second wicket. For Sri Lanka, Kulasekara took three for 53.