Stand-in captain Handré Pollard kicked all of South Africa's points, but the Boks ran out of steam and didn't score in the last 20.
Anscombe, replacing Biggar, closed it to 12-6 before putting a pinpoint late penalty into touch near the Springboks' tryline to set up the game-winning play.
With an advantage for South Africa collapsing a lineout maul, the Welsh forwards worked their way to center field before Anscombe released Adams on a big overlap on the left and he beat the cover defense for his 77th-minute try, the only one of the game. Adams was also on as a replacement early when Alex Cuthbert went off hurt.
Anscombe faced a tough conversion but it sailed through the posts to make history for the Welsh, who have been trying to win a test in South Africa for 58 years.
"There's been some good Welsh teams to come here. Everyone deserves a pat on the back," Biggar said. "I know the Six Nations was disappointing but we were unlucky not to win last week. We'll enjoy tonight and to win the series would be even better."
They have a chance at a series win and South Africa faces a backs-against-the-wall final test, where another loss would put a severe dent in coach Jacques Nienaber's plans a year out from a Rugby World Cup defense.
"We said from the start that we had a plan for 42 players," Nienaber said. "If we had gone the conservative route and stuck with the same (Pretoria) team — and let's say we didn't win the test match tonight — then we would probably have never given the other guys an opportunity.
"There was risk, but the answers you get out of it outweigh the risk."
Before the series, most South African analysts were arguing over how many points the Springboks would win by in each test.
But Wales pushed the first-choice Springboks to the brink in the opening game at Loftus Versfeld and was unlucky to lose that. South Africa escaped with a 32-29 win with a penalty after the final hooter.
"The boys were so keen to get the job done after last week," Pivac said. "We're disappointed we are not 2-0 up. It's a big week for us now."
Wales kept faith with most of its team for Bloemfontein, bringing in Cuthbert for Adams in its only change. Nienaber changed everyone except lock Eben Etzebeth, a decision viewed as disrespectable to Wales by some.
A Wales victory still seemed unlikely when, with the game 3-3 at halftime, South Africa ground itself into a nine-point advantage through Pollard's boot midway through the second half.
But Wales was composed and stayed disciplined to gain the lead, and a late South African surge after the fulltime hooter came to nothing as prop Vincent Koch knocked on and the Welsh celebrated for the first time in South Africa.