Chasing 378 for victory, England got off to a flying start before the loss of three quick wickets forced them on to the back foot.
Root, batting on 76, combined with Bairstow in a 150-run stand for the unbroken fourth wicket to put England's chase back on track.
England were 259-3 at stumps needing 119 for a series-levelling victory.
England's highest successful run chase came in 2019 when they reached a 359-run target in an Ashes test against Australia on the back of Stokes's brilliant unbeaten century.
Earlier, Ben Stokes (4-33) ran through India's lower order and bowled out the tourists for 245.
Rishabh Pant followed his first-innings 146 with 57, and opener Cheteshwar Pujara contributed 66 for India.
The tourists are 2-1 up in the series which could not be completed last year following COVID-19 cases in the India camp ahead of the final match at Old Trafford.
Photo: PHOTOSPORT Caption: Jow Root