The 32-year-old, who made 94 in the first innings, hit an unbeaten 139 as South Africa moved to 298-4 in their second knock by tea at the Chidambaram stadium.
The first game of the three-Test match is headed for a high-scoring draw as South Africa begin the final session with a lead of 211 runs and six wickets in hand.
McKenzie, who was recalled to the Test squad in January after being ignored by the selectors for four years, has so far hit 13 boundaries in his fourth Test century.
He had scored 226 during a world record partnership of 415 with captain Graeme Smith in the previous Test against Bangladesh in Chittagong earlier this month.
McKenzie and his overnight partner Hashim Amla, who resumed at 131-1, batted through most of the morning session to dent India's chances of forcing an unlikely win.
Amla, South Africa's first innings hero with 159, survived two dropped catches to make 81 before he was dismissed five minutes before lunch.
Indian captain Anil Kumble provided the breakthrough by having Amla caught by Rahul Dravid at lone slip.
McKenzie and Amla put on 157 for the second wicket, but the hosts have themselves to blame for allowing the long partnership.
Amla was on 55 when he top-edged a sweep off Harbhajan Singh but Shanthakumaran Sreesanth could not hold the skier running in from deep square-leg.
Amla moved to 72 when he drove seamer Rudra Pratap Singh uppishly but the bowler failed to latch on to a sharp return catch.
Jacques Kallis helped McKenzie add 54 for the third wicket on either side of lunch before Harbhajan cheered some 15,000 home fans with two wickets in 11 balls midway through the afternoon session.
Kallis, who made 19, fell to a superb diving catch at square-leg by Rudra Pratap Singh, while Ashwell Prince was held at forward short-leg by Wasim Jaffer for five.
The wicket, a nightmare for the bowlers, saw South Africa pile up 540 in the first innings and India replied with 627 on the back of a brilliant 319 from Virender Sehwag and 111 by Dravid.
The second Test will be played in Ahmedabad from April 3 and the third in Kanpur from April 11.