The All Blacks had to fight back from a 12-7 half-time deficit, but showed all their resilience and class to book their spot in next Saturday's showpiece.
The Springboks began well with Handre Pollard kicking a third-minute penalty, but the lead was short-lived as Jerome Kaino touched down to give the Kiwis the advantage. Dan Carter added the extras although that was as good as it got for Richie McCaw's men who watched as Pollard added three more penalties before the break.
After the interval Carter reduced the arrears to just two with a drop goal before substitute Beauden Barrett scored his side's second five-pointer on 52 minutes, which Carter inevitably converted.
That gave the reigning world champions a 17-12 lead, but Pollard's fifth penalty closed the gap to just two points.
Carter slotted a penalty of his own through the uprights on the hour mark before Patrick Lambie again brought his side within touching distance with another successful kick for the South Africans.
That was the end of the scoring and, after the bruising contest, McCaw admitted that his men had to leave everything out on the pitch to get the right result.
"We did it the hard way today. It was always going to be that way but we've got a crack at it next week," he told ITV Sport. "Our discipline was keeping them in the game, we had to find that bit extra.
"We've been saying they would bring everything. There were no surprises and we had to dig deep to get the result."
South Africa v New Zealand - Match Highlights - Rugby World Cup 2015