The hosts reached eight without loss in reply at tea, with Virender Sehwag unbeaten on five at the break and Wasim Jaffer on three.
England managed a challenging total despite losing their last seven wickets for 74, thanks to stand-in captain Flintoff's 50 and Shah's impressive knock.
But young seamer Shanthakumaran Sreesanth and Munaf Patel shared four wickets on Sunday to stop England's march towards a massive total despite their team's sloppy fielding.
India dropped three sitters, letting off Flintoff twice and Shah once, before bouncing back into the game.
Sreesanth finished with 4-70, while Patel removed Shaun Udal and Matthew Hoggard off successive deliveries to finish with 2-81.
England were strongly placed on 326-3 following Flintoff's 84-run stand for the fourth wicket with Paul Collingwood (31), before slipping against the Indian seamers.
Sreesanth, like Patel playing only his second Test, got the breakthrough when he had Collingwood caught by wicket-keeper Mahendra Dhoni in his opening spell.
Leg-spinner Anil Kumble then claimed the prize wicket of the big-hitting Flintoff, who was caught at deep mid-wicket by Sachin Tendulkar while attempting a big shot.
The England captain, who made 70 and 51 in the second Test at Mohali, smashed three sixes and six fours in his 85-ball knock.
He was on 29 when dropped off successive balls from Patel, first by Sehwag at second slip and then by Kumble at gully.
Flintoff, who was on 17 in his team's overnight total of 272-3, looked in punishing mood as he drove Patel through the covers for a four early in the day to complete 3,000 Test runs.
England lost one more wicket after Flintoff's dismissal in the morning session when Geraint Jones (one) was caught off an uppish drive by Kumble at gully off Sreesanth.
Shah, who retired hurt Saturday on 50 due to cramps in his hands, continued to bat aggressively on his return -- hitting one six off spinner Harbhajan and 13 fours.
He was dropped on 84 by Dravid at lone slip off Harbhajan before falling to the same combination.
India lead 1-0 in the series following their nine-wicket win at Mohali. The opening match ended in a draw at Nagpur.