Fourth one-day international, Kolkata:
India 317-3 (48.1 ovs) beat Sri Lanka 315-6 (50.0 ovs) by seven wickets
Gambhir (left) hit 14 fours and Kohli hammered 11 fours and a six
Gautam Gambhir and Virat Kohli both hit centuries to take India to a series-clinching seven-wicket win over Sri Lanka in their fourth one-day meeting.
In another high-scoring game, Gambhir made a career-best unbeaten 150, his seventh one-day century, and Kohli scored 107 for his first one-day ton.
Sri Lanka opener Upul Tharanga's 118 had led his side to an imposing 315-6.
But India recovered from 23-2 as Gambhir and Kohli's third-wicket stand of 224 turned the match their way.
The two came together after Virender Sehwag and Sachin Tendulkar were dismissed cheaply and rebuilt their side's innings as they achieved the highest successful run chase in a one-day international at Eden Gardens.
Kohli, replacing the injured Yuvraj Singh, was finally out going for his second six with their partnership only 13 runs short of a record third-wicket total.
India needed another 69 from more than 10 overs but Dinesh Karthik helped Gambhir take them home and put them 3-1 up in the series.
After the match Gambhir was chosen as man of the match but gave his award to Kohli.
"When you have someone at the other end who can attack the bowling, especially when you lose early wickets, it takes the pressure off you," said Gambhir.
"With Kohli attacking I was able to take my time to settle down."
Kohli said: "As a kid I dreamed of getting a hundred for India in a one-day game and I have been able to achieve that - it is a great feeling."
Sri Lanka captain Kumar Sangakkara blamed his bowlers for the defeat, saying: "Once you get 315 on the board you expect your bowlers to really do the job for you.
"But with our bowling we were either too short or too full on either side of the wicket."
The final match in the five-game series takes place in Delhi on Sunday.