Though the result kept South Africa alive in the race for quarterfinals, it may not be enough as they would need not only for results to go in their favour but also for a dramatic change in goal-difference if they are to catch the Germans, who ended the day fourth in the Pool B standings.
Three-time champions Germany, who won the title in 1996, 2008 and 2012, started off well when Timm Herzbruch fired home a penalty corner. However, South Africa were level just a minute later thanks to a penalty corner conversion by Matt Guise-Brown, who slammed a rocket against the backboard.
Keenan Horne put South Africa ahead on the stroke of first quarter, but goals from Lukas Windfeder and Constantin Staib swung the match back in Germany's favour, earning them a 3-2 half-time lead.
Germany battered South Africa throughout the third period, but a superb counter-attack goal inspired by Dayaan Cassiem resulted in Nicolas Spooner levelling the scores at 3-3.
The winner came off the stick of Dayaan's younger brother Mustaphaa Cassiem. The 19-year-old was stunned when he saw his superb cross ending up in the goal via a Germany stick, giving South Africa a famous victory over the European giants.
"It's awesome", said South Africa captain Tim Drummond. "It's something we've trained really hard for and moments like this and results. We knew we had it in us and it's just great for the guys to get this feeling now and hopefully we can remember this feeling," he was quoted as saying by the FIH.
Germany's Lukas Windfeder said: "Our aim was to win here. Then we get 3-2 after a difficult start, we have everything in our own hands, but let us counter stupidly twice. Of course, there should have been more goals today through chances and corners, but it can't be that we have to score five or six goals per game to win. We want to decide the matches for us on good defence. And that doesn't work that way."
Netherlands held by Great Britain 2-2 Great Britain produced an incredible late fightback to steal a 2-2 draw against the Netherlands, a result which put both teams through to the knock-out stages. Both teams have seven points, with Netherlands currently sitting second in the standings above third placed GB due to a superior goal difference.
Thierry Brinkman put the Netherlands ahead in the 22nd minute before a penalty corner from Jip Janssen doubled the Dutch advantage five just a minute after half-time.
Great Britain battled hard to get back into the contest and got the reward that their perseverance deserved thanks to a late double from striker Sam Ward, who guided home an open play deflection before bagging a penalty corner with three minutes left to play. The Dutch had a succession of penalty corners in the final minute, but could not find a way past inspired goalkeeper Oliver Payne, who was outstanding throughout, said a report on the FIH website.
Great Britain striker Sam Ward said: "Coming back from the loss we had the other night - it was pretty tough to lose 5-1 to the Germans - we managed to put a performance in and do ourselves proud."
Netherlands captain Billy Bakker said: "For the first three quarters we were good, but it's difficult to keep up that level for four quarters. In the fourth quarter GB (Great Britain) also played very well - they also have quality - and we weren't focused enough on our defensive positions. We lost the ball a lot and they benefited from that - we needed to keep the ball better. But we're satisfied."