South African captain Faf du Plessis hailed an "impossible" victory after the Proteas recovered from a desperate situation to win the second Test against New Zealand by eight wickets in Wellington on Saturday.

Keshav Maharaj took a career best six wickets as New Zealand crumpled in their second innings and needed just 25 overs to reach the modest 81 to win.

Just five sessions after South Africa were on the ropes they found themselves with an unbeatable 1-0 lead in the series with one Test to play.

New Zealand captain Kane Williamson branded the change in fortunes and his side's second innings capitulation when they were out for 171, as a "very, very poor" effort.

But du Plessis said the result was testimony to the determination of the South Africans.

"It's happened a few times this season where we've been in impossible situations," he said.

"At lunchtime yesterday, 90 for six, it's not too long ago, and here we are.

"We've somehow found this ability to have a lot of faith in our batting line up or whatever, for guys in the team to stand up when there's a pressure situation."

From being 94 for six before lunch on Friday, South Africa rallied to be all out for 359 to take a 91-run lead into the second innings.

On a flattening track and with nearly three days remaining, there was time for New Zealand to mount a strong comeback.

Instead their second innings was done in 63.2 overs with a career best 80 by Jeet Raval and a 65-run partnership between Raval and BJ Watling (29) the only sign of resistance.

Raval's dismissal signalled the beginning of the end as the last five wickets fell for 16 runs.

Faced with the guile of Maharaj's left-arm spin and the seam and bounce of Morne Morkel New Zealand struggled through their second innings.

Maharaj finished with six for 40, the best figures and second five-wicket haul in his fledgling six-Test career while Morkel took the top off the New Zealand innings, including the key wicket of Kane Williamson, to have three for 50.

Du Plessis admitted to being "surprised" because there was not a lot of spin in the wicket.

"I thought both spinners this Test match bowled incredibly well. Their consistency in their areas, the New Zealand batsmen couldn't get way."

New Zealand said before the Test they did not particularly want a green wicket given the high quality of the South African pace attack.

The spin doctors

But it was the South African spinners who did serious damage, claiming six wickets in each innings with Maharaj having match figures of eight for 87.

Williamson said that was disappointing and something New Zealand needed to address.

"We have to do a lot better," he said.

"It wasn't offering a huge amount of spin so it is something as a batting unit we're disappointed in."

Morkel removed Tom Latham, Williamson and Neil Broom to have New Zealand at three for 64 early in their second innings.

Once Williamson fell for one, New Zealand needed the remaining batsmen to step up but instead Neil Broom, Henry Nicholls and Jimmy Neesham could only add 31 in total before BJ Watling joined Raval to halt the flow of wickets.

On 53, Raval was dropped by JP Duminy in the gully and on 67 he charged down the wicket to Duminy and missed the ball, but so too did wicketkeeper Quinton de Kock when a stumping was on the cards.

De Kock made amends the next time Raval danced down the wicket and completed the stumping for Maharaj's third wicket.

The third and final Test starts in Hamilton next Saturday.