Running in lane four, Thando Dlodlo, Gift Leotlela, Clarence Munyai and Simbine just edged Brazil to the line in 38.71 seconds.
The race was so close that Brazil was celebrating the victory before South Africa was announced as the winners.
The South Africans beat the South Americans to the line in just 0.01 seconds.
To make matters worse for Brazil, they were then disqualified for running out of their lane.
Ghana ran a brilliant race to cross the line in third, however, they were also disqualified.
The silver was awarded to Italy, with Japan rounding off the podium.
The win will be a massive confidence booster heading to the 2021 Olympic Games in Tokyo, Japan later in the year.
They will be confident of a medal at the summer games which was delayed by a year due to the ongoing global Covid-19 pandemic.
News: We applaud South Africa's ???????? #WorldRelays2021 team led by @AkaniSimbine for clinching a gold medal in a sensational victory in the 4x100m race at the World Athletics Relays in Poland. In this breathtaking performance, #TeamSouthAfrica ???????? clocked a time of 38.71 seconds. pic.twitter.com/BczQ8oQiyM
— Min. Nathi Mthethwa (@NathiMthethwaSA) May 3, 2021