Their 267-run stand, smacked in 30 overs at Dunedin's University Oval, is the highest sixth-wicket partnership in ODI cricket and began when New Zealand were in dire straits at 93-5 after 20 overs.
The innings ended with Ronchi unbeaten on 170, his maiden ODI century, while Elliott was 104 not out for his second ton.
After being sent into bat on a green-tinged wicket, New Zealand's top order fell rapidly before Elliott and Ronchi turned the mission around.
Elliott, dropped on 47 by stand-in Sri Lanka captain Lahiru Thirimanne, faced 96 balls and hit two sixes and seven fours.
Also Read
Thirimanne, promoted to lead Sri Lanka when Angelo Mathews was rested with a calf strain, won the toss and was immediately rewarded for opting to bowl with Martin Guptill caught behind first ball.
In the following over, Brendon McCullum was dropped at backward point by Tillakaratne Dilshan and New Zealand were having trouble with the ball moving sharply off the seam.
Two overs later Williamson was back in the pavilion, caught by Sangakkara off Thisara Perera for 26 and New Zealand were 60-3.
Ross Taylor and Grant Elliott had added 20 runs when Sri Lanka struck another double blow with two wickets to Thirimanne in 11 balls.
Taylor popped a catch to Dimuth Karunaratne at mid-wicket to be gone for 20 while Corey Anderson was trapped leg-before for eight.