Lahore: South Africa plucked four wickets including the vital scalps of Younis and Yousuf in the final session and took a grip on the second Test on day two here after Pakistan spoiled their solid start.
The home team were precariously placed at 140-4 when bad light stopped play eight overs before schedule in reply to South Africa's first innings total of 357 on a day of fluctuating fortunes at the Gaddafi Stadium.
Inzamam-ul Haq was given a guard of honour by the South Africans as he came onto the ground to bat in his final Test before retirement.
The 37-year-old former skipper was unbeaten on 10 with Misbah-ul Haq who was also on 10.
South Africa won the first Test in Karachi last week by 160 runs in the two-match series.
Salman Butt (40) and Kamran Akmal (52) gave Pakistan a confident start of 90 before the home team lost three wickets in the space of just nine runs.
Butt looked in great touch but failed to keep a sweep down and was caught by Graeme Smith off left-arm spinner Paul Harris who finished with 2-33.
Butt hit seven boundaries during his 68-ball knock.
Mohammad Younis, who hit a fighting 126 in the first Test, did not last long. He missed an Andre Nel incoming delivery and was bowled for three.
Akmal became Harris's second victim in the innings when he failed to keep a drive down and was caught by Smith in the covers. Akmal hit seven boundaries.
It was left to senior pros Yousuf and Inzamam to steady the innings. Yousuf shaped well for his 25 before he was trapped in front of the wicket by paceman Dale Steyn for his 50th wicket in 13th Test.
Inzamam, needing 20 to pass Pakistan's highest Test aggregate held by Javed Miandad with 8,832 runs, looked out of sorts initally before hitting Nel for a boundary.
Earlier, Pakistan squandered the first day's initiative when Mark Boucher scored 54 and a career-best 46 from Paul Harris took the tourists to a respectable total after they resumed at 259-6.
Pakistan had dismissed the overnight batsman Andre Nel for nought off the fifth ball of the day when paceman Umar Gul had him caught fending a short delivery.
Harris showed remarkable guts as the tail-ender improved his best Test score of 11 made against India in Cape Town earlier this year.
Pakistan captain Shoaib Malik once again did not use left-arm spinner Abdul Rehman until half-an-hour before lunch.
It was Gul who finally broke the stubborn stand when he had Harris driving uppishly and was caught by Malik in the covers. Harris hit six boundaries during his resolute 160-minute knock.
Boucher was the last man out when he holed out at leg-spinner Danish Kaneria who was the pick of the home bowlers with 4-114. He hit Kaneria for a six to reach his 26th half-century.
Boucher hit four boundaries and a six during his 132-ball knock.
Kaneria was the best of Pakistan's bowlers with 4-114, while Gul finished with 3-103.