There is no capital gains tax to pay not even for foreign investors, but if you are leaving New Zealand to go to another country, for example back to your home country or to emigrate elsewhere, then there may be the need to declare the money upon your arrival in the new country.