Williamson scored centuries in both innings of the first Test in Mount Maunganui, which New Zealand won by 281 runs.
South Africa took a 31-run first innings lead in the second match in Hamilton and extended that to 267 by making 235 in the second innings.
New Zealand reached 40-1 before stumps on day three, setting up a fourth day on Friday when they needed a further 227 while South Africa needed nine wickets to end the series 1-1.
The Black Caps' total of 3-269 was their fifth-highest in a successful fourth-innings run chase, and was a record Test fourth-innings run chase at Seddon Park.
South Africa was, however, considerably under-strength as most of their leading players remained at home to play in a domestic Twenty20 league.
Six Proteas players including captain Neil Brand debuted in the first Test, while their XI in Hamilton boasted only 51 Tests in total compared to New Zealand's 436.
South Africa's bowlers made New Zealand grind their way to a victory. The winning runs finally came in the 95th over, about 20 minutes before the end of day four.
Playing almost a lone hand at first, Williamson built his 32nd test century from 203 deliveries. He put on 64 for the third wicket with Rachin Ravindra (20), then found a resolute partner in Young, who finished 60 not out.
Williamson is one of only two active players along with Australia's Steve Smith to reach 32 centuries and has done so faster, in 172 innings, than Smith, Ricky Ponting, Sachin Tendulkar, Younis Khan, Sunil Gavaskar, Kumar Sangakarra, Jacques Kallis or Brian Lara, among others.
Test cricket's top-ranked batter showed all his powers of concentration in difficult conditions Friday, with the ball turning and bouncing. His three tons in four innings helped him to 403 runs at an average of 134, compiled in almost 18-1/2 hours.
"Coming into today on a wearing surface we knew we were going to have to string partnerships together," Williamson said.
"Credit to South Africa. Certainly for the first couple of days they outplayed us I thought.
"We had to fight hard to get out of that position and change momentum and with the partnerships and seeing off the new ball were able to give ourselves the chance."
South Africa played much better than expected for such an inexperienced side.
"We're definitely more disappointed after this Test match, especially as we were still in it at the end of day three," Brand said.