New Zealand stunned favourites South Africa by 49 runs in the quarter-final at Mirpur to knock the Proteas out of the World Cup.