The game was reduced to 44 overs a side after a rain delay of two and a half hours and Pakistan's excellent bowling effort has put them in with a chance of levelling the series after losing the opening match by 125 runs.
Irfan took full advantage of the pace and variable bounce in the wicket to return figures of four for 33. He started the South African collapse when Hashim Amla (17) got an inside edge and was picked up by wicketkeeper Kamran Akmal.
Live Scoring
The next ball, Colin Ingram, who scored a century in the first game, was judged caught behind by third umpire Kumar Dharmasena after the on-field official gave it not out.
AB de Villiers (4) then tried to guide Irfan to third man but succeeded in picking out Younus Khan at a second slip, before Graeme Smith (10) attempted to pull a Junaid Khan delivery and got a faint edge through to Akmal.
Faf du Plessis (17) was undone by the extra bounce from Irfan and South Africa were teetering on 62 for five.
They started a fight-back when Ryan McLaren (17) put on 44 for the sixth wicket with Farhaan Behardien before he was lbw to Mohammed Hafeez.
Robin Peterson (44) and Behardien (58) added another 67 runs before the latter tried to hit Hafeez over the mid-wicket boundary and picked out Shoaib Malik in the deep.
Teams:
South Africa:
Graeme Smith, Hashim Amla, Colin Ingram, AB de Villiers (captain/wk), Faf du Plessis, Farhaan Behardien, Ryan McLaren, Robin Peterson, Dale Steyn, Kyle Abbott, Lonwabo Tsotsobe.
Pakistan:
Nasir Jamshed, Mohammad Hafeez, Younus Khan, Misbah-ul-Huq (captain), Shoaib Malik, Kamran Akmal (wk), Shahid Afridi, Umar Gul, Saeed Ajmal, Junaid Khan, Mohammad Irfan.