Dilshan made 112 off 133 balls as Sri Lanka progressed to 275-3 at close with Thilan Samaraweera batting on 45 while former skipper Mahela Jayawardene was unbeaten on 36.
The visitors trailed by 151 runs after India was dismissed for 426 in its first innings earlier in the day.
India did well in the last session after Dilshan had dominated the 115-run second wicket stand with captain Kumar Sangakkara (30), as Zaheer Khan (2-45) removed both batsmen in successive overs with short pitched deliveries.
Dilshan raised his 10th Test century with a ferocious square cut boundary off paceman Ishant Sharma before he mistimed a pull short and offered an easy catch.
His century included 12 boundaries - mostly on the offside - on an easy paced wicket at Motera.
Sangakkara also misjudged a pull shot and holed out in the deep to Sachin Tendulkar as Sri Lanka lost two wickets inside five runs.
Samaraweera and Jayawardene then played watchfully and put on 81 runs for the unbroken fourth wicket stand.
Sri Lanka started off well with Tharanga Paranavitana (35) and Dilshan providing a confident opening stand of 74.
Sri Lanka lost only Paranavitana in the middle session when India captain Mahendra Singh Dhoni held a low, one-handed catch off paceman Sharma's delivery which left the left-hander and got a thick outside edge.
Dilshan faced little trouble in negotiating spinners Harbhajan Singh and Amit Mishra as he punished loose deliveries with some attractive boundaries. Both Indian spinners bowled 38 overs in between them but were still searching for their first wicket.
Earlier, the Sri Lankan bowlers rallied with four wickets in the morning session after India had resumed at 385 for six.
Off-spinner Muttiah Muralitharan, playing what could be his final test series on foreign soil, took three wickets in the session.
But it was Chanaka Welegedara who made the early breakthrough, as he had on Monday, by removing Rahul Dravid for his overnight score of 177.
Dravid had withstood Welegedara's damaging first spell on the opening day - when the rookie paceman took three wickets and had the hosts reeling at 32-4 - and led India's innings revival in important partnerships with Yuvraj Singh (68) and Dhoni (110).
But Welegedara knocked back the stumps in the second over Tuesday when Dravid left a big gap between bat and pad as he attempted to drive down the ground.
Dravid's innings lifted him to fifth in the all-time test scorers after Sachin Tendulkar (12 777), Brian Lara (11 953), Ricky Ponting (11 345) and Allan Border (11 174).
He faced 261 deliveries and hit 26 boundaries and a six in a display of brilliant temperament and strokemaking.
Muralitharan ran through the Indian tailenders as he trapped Zaheer Khan lbw for 12, bowled Harbhajan for 22 and got last man Sharma stumped without scoring.
Welegedera finished with 4-87 while Muralitharan returned 3-97.