Cook chipped in with 59 and Ravi Bopara smashed 28 runs from the final over after Sri Lanka grabbed four wickets for five runs towards the end to make it 254-7 in the 48th over.
Bopara boosted the total with three sixes, two boundaries and a two in the 50th over sent down by seamer Shaminda Eranga to return unbeaten on 33 off 13 balls.
Root, the victim of what England cricket authorities said was an "unprovoked physical attack" by Australian batsman David Warner in a Birmingham bar over the weekend, hit five fours. The Islanders, chasing England's seemingly impregnable 293-7, launched a spirited chase in the day-night game at the Oval to surpass the target in 47.
1 overs and throw open the semi-final race from group A.
Sri Lanka, who would have been knocked out of the tournament had they lost, are now level with England on two points each, one behind group leaders New Zealand.
Australia, the fourth team in the group, have one point.
The two semi-final spots will be determined aft