Kiwis edge thriller to reach first World Cup final