New Zealand beat Sri Lanka by 61 runs to knock the co-hosts out of the T20 World Cup and boost their own semi-final hopes.