Williams netted in the 32nd and 41st minutes either side of a 34th-minute effort by Trinity Rodman at Cincinnati's TQP Stadium to give the US women a comfortable victory.
The friendly was the USA's first game since they were dumped out of the World Cup in the last 16 by Sweden in August –- the USA's earliest ever exit from the global football showpiece.
The World Cup flop led to the resignation of coach Vlatko Andonovski, leaving Twila Kilgore in charge for Thursday’s game in Ohio.
There was little sign of a World Cup hangover by the hosts, however, with the home team quickly on the front foot against South Africa, who reached the last 16 at the World Cup but lost to the Netherlands.
The Thursday Night Fútbol highlights 🎥 pic.twitter.com/ItytrFkEjS— U.S. Women's National Soccer Team (@USWNT) September 22, 2023
Williams' opening goal came from a corner on the left, with the Gotham FC forward heading in from close range to make it 1-0.
Two minutes later, Rodman doubled the American lead, coolly tucking away a low finish after a fine run and cross by Alex Morgan down the left.
Williams completed the scoring on 41 minutes, tapping in from a few yards out after South Africa failed to deal with another American setpiece.
Thursday's game also served as a formal farewell to US veteran midfielder Julie Ertz, who is retiring after a 123-cap international career that saw her win World Cups in 2015 and 2019.
Ertz started the game as captain before being substituted in the 35th minute to a standing ovation.
The US women will face South Africa again in a second friendly in Chicago on Sunday that will mark the final international game of Megan Rapinoe.