Gambhir put on 130 runs with Sachin Tendulkar (68) and also shared 139 runs with Venkatsai Laxman (54 not out) for the unbroken fourth wicket after the hosts were reeling at 27-2 in the morning session.
The opener, who bettered his previous-best knock of 139 against Bangladesh, was involved in verbal sparring with the tourists, who must avoid defeat here if they are to keep alive their chances of retaining the Border-Gavaskar trophy.
They trail 1-0 in the four-Test series after losing the previous match in Mohali by 320 runs. The opener in Bangalore ended in a draw.
Tensions between the two teams came to the boil when Gambhir apparently elbowed Shane Watson while taking a second run after the all-rounder seemed to mutter something to the batsman.
Sachin equals record for maximum fifties
Watson unleashed a nasty bouncer in his next over but Gambhir responded by lofting him for a six over long-on to bring up his third Test century and second on the trot after his second-innings 104 in Mohali.
The left-hander also became involved in a spat with part-time bowler Simon Katich and umpire Billy Bowden had to intervene.
The trouble started when Katich apparently tried to obstruct Gambhir from taking a run and the Indian made his displeasure known. Katich charged at Gambhir but Michael Clarke pulled him away and Bowden stepped in promptly.
Indian batsmen reaching 100 with a six
Laxman, playing his 99th Test, batted with composure amid all the action around him, reaching his 36th Test fifty.
Tendulkar made a fine 68 with 11 boundaries before edging behind to wicketkeeper Brad Haddin off Mitchell Johnson (2-69) in the last over before tea.
Tendulkar, 35, looked in sublime touch during his 124-ball knock, whipping Cameron White past extra cover and following it up with a slog sweep over midwicket to force the leg-spinner out of the attack.
The star batsman reached his 51st half-century with a four off Stuart Clark, who conceded just 29 runs off his 21 overs but failed to take a wicket.
Gambhir, Watson come close to face off
The hosts lost in-form opener Virender Sehwag (one) and the usually dependable Rahul Dravid for 11 after Anil Kumble won the toss and elected to bat on an easy-paced track.
Sehwag had faced just two balls when he was trapped leg before off Brett Lee (1-70) in the third over of the day.
Dravid hit Johnson for a four to fine leg but then edged the bowler to Matthew Hayden, celebrating his 37th birthday, in the slips.
The fourth and final Test will be played in Nagpur from Nov 6-10.