New Zealand authorities withdrew a tsunami warning following a 5.9-magnitude quake on the western coast of the South Island.