A video analyst and two players – James Monyane and Kamohelo Mahlatsi – tested positive for coronavirus on Sunday, with 21 members of the team contingent named as close contacts the following day.
Strict anti-virus protocol meant they had to stay in their rooms and eat meals alone, and the team missed two training sessions until they were allowed to resume.
Athletes designated as close contacts at the Tokyo Olympics must test negative six hours before their event to be allowed to compete.
There were fears the match in Tokyo would not be able to go ahead if South Africa could not register the required minimum 13 players.
But they cleared that hurdle with six substitutes named on their bench, and almost claimed an unlikely point against Japan with a battling performance.
Real Madrid forward Takefusa Kubo ended their resistance in the 71st minute, however, cutting into the box before lashing home a left-foot shot.
Japan had the better of the first half but failed to convert their chances, with Kubo and Koji Miyoshi both wasting good opportunities.
Daichi Hayashi put the ball in the net only for the linesman to flag for offside, before Kubo ended the first half with a free-kick that whistled narrowly past the post.
Hayashi had another golden chance in the second half, but South African goalkeeper Ronwen Williams pulled off an excellent save from close range.