South Africa were facing a sizable deficit without Vernon Philander when England started their second innings at Lord's after the paceman was struck on the hand by a delivery from James Anderson.
Philander frustrated England with a sixth Test half-century on day three despite taking a nasty blow to his bowling hand before he had got off the mark.
The quick showed great character after that painful blow, making 52 before he was the last man out.
Philander took 3-67 in the first innings, but he was unable to take the new ball second time around after being taken to hospital for an X-ray.
Quinton de Kock made the second-fastest half-century in a Test at Lord's as the Proteas were all out for 361 to trail England by 97 runs in the first Test.