Earlier, young Thakur registered his best T20 bowling figures as Sri Lanka lost their way in the middle overs after Kusal Mendis' fifty and were restricted to 152 for nine.
The match was reduced to 19-overs-a-side affair after over an hour was lost due to rain.
India didn't have the best of starts with the bat as they lost openers Rohit Sharma (11) and Shikhar Dhawan (8) early in the chase. The captain's form will certainly be a worry for the team going ahead in the tournament.
KL Rahul, who came into the team in place of Rishabh Pant stitched important partnership with Suresh Raina to get India back on track.
Just when it seemed India would coast home, they experienced a bit of a stutter as Raina and Rahul departed in quick succession. Rahul also became the first Indian to be dismissed hit-wicket in T20Is.
But Karthik and Pandey showed great maturity and the two ensured India didn't face any more trouble.
Sri Lankan pacers disappointed yet again as they bowled way too many loose balls, Akila Dananjaya was the star of the show as he picked two wickets.
Sent into bat, Mendis once again shone bright for Sri Lanka scoring 55 off 38 balls with the help of three fours and as many sixes before Indian bowlers led by Thakur brought their side back into the game with wickets at regular intervals.
Thakur returned with impressive figures of 4/27, while young off-spinner Washinton Sundar (2/21) scalped two wickets as India made a strong fightback after leaking runs in the first 10 overs.
Vijay Shankar (1/30), Yuzvendra Chahal (1/34) and Jaydev Unadkat (1/33) also accounted for a wicket each.
But initially it looked Rohit Sharma's decision to bowl first backfired as Sri Lanka got off to a flier scoring 24 runs off the first two overs.
Left-arm pacer Unadkat was taken to the cleaners as he gave away 15 runs in the first over. But India pulled things back bit with two wickets in back-to-back overs.
Thakur gave India the breakthrough when he dismissed Danushka Gunathilaka (17) in the third over with Suresh Raina taking a stunning catch at midwicket.
Sundar then cleaned up in-form Kushal Perera (3) in the next over as the batsman went for an expansive reverse sweep.
But thereafter Kusal Mendis took the the Indians bowlers to task in Upul Tharanga's (22) company as the duo added 62 runs for the third wicket to help Sri Lanka reach 94 for two after 10 overs.
Kusal Mendis continued his good form and did not spare a single Indian bowler while Tharanga preferred to play the second fiddle.
Kusal Mendis used the crease to great effect to hit most of his scoring shots on his favourite left side.
Shankar broke the dangerous-looking partnership when he bowled Tharanga in the 11th over.
But Shankar himself spoilt his good work, courtesy two bad deliveries which were clobbered over the boundary by Lankan stand-in skipper Thisara Perera (15).
In between, Kusal Mendis brought up his fourth fifty in five innings in just 31 balls.
But India pulled Sri Lanka back again with three more quick wickets in the form of Thisara Perera, Jeevan Mendis and set Kusal Mendis.
While the Lankan skipper perished in search of one too many big shots, caught by Chahal off Thakur, Sundar went through Jeevan Mendis's defence with his guile.
The big blow for Sri Lanka came when Kusal Mendis departed next, giving away a soft catch to Rohit off Chahal.
Thakur then dimissed Dasun Shanaka (19) and Dushmantha Chameera in consecutive balls in the 19th over to stand in with a chance to claim a hat-trick which didn't come.
(With PTI Inputs)
First Published: March 13, 2018, 8:10 AM IST