Now victory over England at the same venue Tuesday will guarantee the Kiwis, winners of the second edition of the Champions Trophy in Kenya nine years ago, a place in the knockout phase.
New Zealand overcame a mid-innings blip that saw five wickets fall cheaply to reach 315-7 off 50 overs with Martin Guptill (66), skipper Daniel Vettori (48) and McCullum (46) other significant contributors.
Sri Lanka were all out for 277 off 46.4 overs in reply with the big early stands they needed never materialising and it was left to Mahela Jayawardene (77) to keep hopes flickering until he became the seventh wicket to fall.
Nuwan Kulasekara, ranked among the top fast bowlers in the world, proved he is no slouch with the bat either, hitting an unbeaten 57 off 56 balls, including four sixes and two fours.
It was a disappointing final mini-league outing for the Sri Lankans, who began with a bang last Tuesday by surprising hosts South Africa before suffering a six-wicket loss to England.
"I am particularly happy with our batting because we have been struggling in that department for a long time. When your openers put on 100-plus runs it injects good spirit in the team," said Vettori.
"We did stumble a bit after Jesse went but regained our momentum on a fantastic wicket which offered pace but did not go round. Now our fate is in our hands."
Sri Lanka skipper Kumar Sangakkara lamented poor fielding: "It is no use having good batsmen and bowlers if your fielding is not up to scratch. This has been a problem for some time and is costing us any chance of trophies."
Vettori has repeatedly stressed the need for good partnerships and his wish was realised by Ryder, who hit 10 fours and a six before edging Kulasekara to Sangakkara behind the stumps.
His departure triggered a collapse with the Kiwis slipping to 161-5 before Guptill and Vettori regained the initiative on a scorching day in the South African financial capital.
Vettori averaged more than a run a ball before becoming the third victim of 40-year-old Sanath Jayasuriya, whose slow left-arm deliveries brought three wickets and caused the Black Caps' batsmen most discomfort.
Guptill was bowled by Lasith Malinga and James Franklin, rushed from English county championship duty with Gloucestershire to replace injured Jacob Oram, contributed an unbeaten 28 as the Sri Lankan sting evaporated.
Tillakaratne Dilshan (41) mistimed a pull to deep square leg where substitute Jeetan Patel took the catch and the poor batting form of fellow opener Jayasuriya (24) continued as his pull took a top edge to midwicket.Sangakkara made only 11 before edging to first slip and Thilan Samaraweera (17) fared little better before a cut to backward point was snapped by Neil Broom.
At 123-4 after 20 overs Sri Lanka were in trouble and the run out of Thilina Kandamby (11) and cheap exit of Angelo Mathews (two) after a clumsy shot confirmed the game and the tournament was slipping from their grasp.
Jayawardene offered a glimmer of hope as he dug in with Kulasekara, but his wicket was snapped when foxed by a quicker Vettori delivery and the ball sent the off-stump flying.