Police are among the injured in the attack at a building and construction site.
The shooting is being treated as an isolated incident, not a national security threat.
The incident began on Thursday outside a building on Queen St, Auckland's main thoroughfare, about 7.20am, when locals reported hearing gunfire.
Local media reported the gunman was a 24-year-old man who worked at the building, and who had arrived there with a pump-action shotgun.
Colleagues thought he was conducting a prank until he opened fire.
Police said he "moved through the building site and continued to discharge his firearm".
"Upon reaching the upper levels of the building, the male has contained himself within the elevator shaft," the police statement read.
"Further shots were fired from the male and he was located deceased a short time later."
Local television outlets broadcast footage of workers on the roof of the building hiding behind packs of pre-mix cement.
Dozens of police vehicles, a helicopter and several ambulances scrambled to attend the site.
Mr Hipkins said he had "deep sorrow" for the two victims, who he understood were civilians and not police.
"I want to thank the brave men and women of the New Zealand police who ran into the gunfire, straight into harm's way in order to save the lives of others," he said.
"These kind of situations move fast and the actions of those who risked their lives are nothing short of heroic."
Police said the incident was "understandably alarming" but contained, and understood to be an isolated incident.
Mr Hipkins said there would be no change to the country's terror settings, and there was not believed to be a political or ideological motivation.
The NZ Herald reported the gunman was serving a community-based sentence of home detention for family violence offences.
He was wearing an electronic ankle bracelet, but such sentences in New Zealand can allow offenders to continue working.
St John Ambulance confirmed six injuries - three serious and three moderate - in addition to the deaths.
Australian Prime Minister Anthony Albanese, who is to visit Wellington next week, offered condolences to Mr Hipkins.
"I've been in contact with with Chris this morning about that. And that is very sad indeed to see another dreadful shooting with fatalities here in New Zealand," he said.
The incident has taken place on the first day of the Women's World Cup, with NZ set to play Norway in the tournament's opening match at Eden Park, five kilometres south.
Mr Hipkins said after government conversations with FIFA officials, there would be no change to the tournament schedule.
Norway are staying at a hotel in close proximity to the shooting site.
The FIFA Fan Festival is also nearby, where former Kiwi international Maia Jackson was spending her morning.
"It's pretty scary actually ... there's lots of security and lots of uncertainty," she told the NZ Herald.
Mayor Wayne Brown told TVNZ the attack was "dreadful".
"It couldn't have come come at a worse time given the world has its eyes on us now with the FIFA soccer thing," he said.