Dramatic tie puts South Africa through