Six other people, including police officers, were injured and the gunman is also dead after the incident at 07:22 (19:22 GMT) on a construction site in the central business district.
PM Chris Hipkins said the attack was not being seen as an act of terrorism.
The tournament would go ahead as planned, he confirmed.
While no political or ideological motive for the attack had been identified, police had neutralised the threat and the public could be assured that there was no ongoing risk, the prime minister said.
He added that the gunman had been armed with a pump-action shotgun when he arrived at a construction site on Queen Street on Friday morning.
Mr Hipkins thanked “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.
“These kinds of situations move fast and the actions of those who risk their lives to save others are nothing short of heroic”.
According to Auckland Mayor Wayne Brown, all Fifa personnel and football teams are safe and have been accounted for. Earlier, he had warned people to stay home and avoid travelling into the city.
“I can’t remember anything like this ever happening in our beautiful city. This morning’s events have been tragic and distressing for all Aucklanders, as this is not something that we are used to,” Mr Brown wrote on Twitter.
Fifa expressed its “deepest condolences” to the victims’ families and said it was in communication with New Zealand authorities.
“The participating teams in close proximity to this incident are being supported in relation to any impact that may have taken place,” it said.
The opening match is to be held between New Zealand and Norway in the city’s Eden Park.
Sport Minister Grant Robertson said there would be extra police in the area to provide reassurance.
The ninth Women’s World Cup is being co-hosted by New Zealand and Australia.
Police said they heard reports of a person discharging a firearm inside the construction site, and the gunman moved through the building and continued to fire.
The man then went into a lift shaft and police attempted to engage with him.
Further shots were fired by the man and he was found dead a short time later, police said.
Following the shooting there was a large armed police presence in the central business district not far from the waterfront and the fan park.
Tatjana Haenni, chief sporting director for National Women’s Soccer league USA, is staying close to where the shooting happened.
She told BBC News she had woken up to sounds of police cars arriving and was told to stay inside. “So far we feel safe,” she said.