Neil Wagner of New Zealand, right, was among the wickets in the second test win over Pakistan in Hamilton on Tuesday.

A late charge from New Zealand's bowlers has seen them score a dramatic win over Pakistan in the second cricket test in Hamilton.

Needing 369 to win the second test at Seddon Park to draw the two-match series, Pakistan were dismissed in their second innings for 230.

The Black Caps took nine wickets in the final session to win the test by 138 runs, and took the series 2-0 after winning the first test in Christchurch.