Clothing store Verily was still open despite the outage, with co-owner Vera Aperloo working in dim conditions.
"It just went off, my sister who was in the back thought it was me doing something."
New Zealand's power-system operator, Transpower, said the fault was caused during testing of the high-voltage cable between the North and South Islands, at the Hutt Valley substation.
There were reports of a large bang at the substation.
A notice to Transpower customers on Monday said a system disturbance test would be taking place on Tuesday, staging a line fault mimicking what could happen if lightening hit electricity lines.
It had not expected the test to cause any issues.
An automatic system switched the power off when the problem was detected preventing the whole country from being affected, said Phil Marsh, electricity distributor Powerco's network operations manager.
"The system protects the integrity of the national grid," he said.
The company began restoring power to affected areas when it was given the go ahead by Transpower.
Most shops in Masterton had power back by noon and the other areas in the North Island were expected to have power restored by 2pm.