The assault took place late Friday in the low-income neighbourhood of Les Moulins, reputed to be a drug-dealing hub, in the west of the city.
Two of the five wounded people were minors, prosecutors said.
On Saturday, traces of blood were still visible on the ground as people went about their business. Two flower pots were placed on the sand to cover the blood stains.
The attackers, travelling in a Peugeot car, opened fire on people near a drug-dealing spot Friday evening in the central square of the Les Moulins neighbourhood, which is home to around 8,000 people.
READ ALSO: Two dead in apparent 'drug-related' shooting in southern France
A vehicle matching the description of the one used by the suspects was found burnt out in the town of Mougins not far from Nice shortly before midnight.
Prosecutor Damien Martinelli said on Saturday that the shooting was linked to drug trafficking but some of the victims were believed to be inadvertently shot.
"While these events appear to be clearly linked to drug trafficking, several of the victims appear to have no connection to it," he told reporters.
"The gunshots may have been fired indiscriminately at those present," Martinelli added.
One of the victims injured in the shooting remained in critical condition, a police source said.
Some 60 police officers were brought in to help ensure security in Les Moulins as Nice mayor Christian Estrosi urged Interior Minister Bruno Retailleau to make the deployment "permanent".
Estrosi said he had urged "a tougher fight against immigration", alleging that this "fuels drug-related crime and terrorism".
READ ALSO: 'Witnesses to despair': Marseille sees poverty fuel cocaine problem
"With personnel mobilised continuously every day and night, the security operation now involves more than 100 officers," the prefecture said in a statement.
The police officers would remain there for as long as necessary, the prefecture added.
'Enough is enough'
Officials launched a murder investigation, perpetrated by an organised crime gang, as well as attempted murder and criminal conspiracy.
French authorities have vowed to intensify the fight against narcotics and drug-related crime.
Officials have warned that the drug-related violence is spreading across France, with shootouts now erupting in what were previously quiet corners of the country.
READ ALSO: Cocaine use nearly doubles in France: study
Gangland violence long associated with big cities like the southern port of Marseille has expanded, with victims and perpetrators getting increasingly younger.
While drug-related violence in Nice has not reached the levels seen in Marseille or the Paris region, it remains a problem.
In April, a 28-year-old man was shot dead in Nice.
READ ALSO: Macron vows 'unprecedented operation' against drugs in Marseille
In July 2024, seven members of one family, including four children, died in an arson attack in Les Moulins.
"Stop, enough is enough, Nice must not become Marseille," conservative politician Eric Ciotti said on X.