After jumping to a 19-7 lead though tries by Cecil Afrika, Boom Prinsloo and Bernardo Botha, the Boks looked assured of beating the sevens specialists, but instead had to watch the Fijians score the match winner after the siren for full time.
Their next match will be against the USA in the plate semi-final.
It was by far the best performance coach Paul Treu's charges dished up at the tournament thus far.
Unlike in the first day's play, the Boks held the ball well, supported tackled players as if their lives depended on it and defended bravely for most of the match.
Fiji were first to score when Seremaia Buroto went over under the posts, but the young South Africans remained composed and played superbly to ensure they have a 14-7 lead at half-time.
Botha then added five more when he finished in the corner before the resurgent Fiji squad came from behind to snatch victory.
Despite the loss, the improvement from the first day's play will be encouraging as the only thing needed now may be a bit of big match temperament.
Scorers:
Springboks 19 (14) Tries: Cecil Afrika, Boom Prinsloo, Bernardo Botha. Conversions: Afrika (2)
Fiji 21 (7) Tries: Seremaia Buroto (2), Nasoni Roko. Conversions: Emosi Vucago (2), Roko
Cup quarterfinals results:
Samoa 38 USA 5
Fiji 21 South Africa 24
Australia 19 England 21
New Zealand 35 Wales 7
Cup semi-finals
Samoa v Fiji
England v New Zealand