The victory was set up by spinners Ajantha Mendis and Sachithra Senanayake, who shared seven wickets to restrict the reigning world champions to 264-9 in the day-night match in Fatullah.
But Sri Lanka lost wickets at regular intervals and were reduced to 216-7 in the 44th over when Thisara Perera helped Sangakkara add 42 crucial runs for the eighth wicket.
Left-handed Sangakkara, who hit 12 boundaries and a six in his 18th one-day century, fell in the penultimate over when just seven runs were needed for victory.
But Mendis and Perera saw Sri Lanka through with four deliveries to spare in a nail-biting finish, giving their team a second win after they beat Pakistan in the tournament opener.
India, who won against Bangladesh, must defeat arch-rivals Pakistan in Dhaka on Sunday to stay in contention for a place in the final.
Opener Shikhar Dhawan scored 94 as India, sent in to bat, moved to 175-2 in 35 overs before losing five wickets for 40 runs to slide to 215-7.
Big hitting by the lower order, including two sixes by last man Mohammed Shami off Mendis, lifted India past the 250-run mark.
Mendis, who replaced seamer Suranga Lakmal for the match, justified his selection with four for 60, including the key scalps of Dhawan and stand-in captain Virat Kohli.
Off-spinner Senanayake finished with his best one-day figures of three for 41 as the Indians struggled against the turning ball on the slow wicket.
Kohli, leading India in the absence of the injured Mahendra Singh Dhoni, put on 97 for the second wicket with Dhawan after Rohit Sharma had been trapped leg-before by Senanayake for 13.
Kusal Perera and Lahiru Thirimanne gave Sri Lanka a flying start with a 80-run partnership for the first wicket by the 18th over.
Off-spinner Ravichandran Ashwin removed both openers, trapping Thirimanne leg-before for 38 and then having Kusal Perera caught behind for 64.
India bounced back strongly when left-arm spinner Ravindra Jadeja dismissed Mahela Jayawardene and Dinesh Chandimal with consecutive deliveries to reduce Sri Lanka to 148-4 in the 32nd over.
Seamer Mohammad Shami, who conceded 42 runs in his first six overs, returned for a spell and trapped skipper Angelo Mathews leg-before with his second ball.
Shami also had Senanayake caught at mid-wicket and Jadeja had Chaturanga de Silva leg-before as Sri Lanka slumped to 216-7.
Afghanistan will take on hosts Bangladesh in the next match in Fatullah on Saturday.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ