He took the first five wickets to fall in Johannesburg but could not stop South Africa from letting the advantage slip