The majority belonged to Mongrel Mob (810), followed by Black Power (505) and Crips (264).
At 35 per cent, the ratio of gang members to other prisoners was the highest it had been. The data only went back to 2010, when it was 14 per cent.
In 2017, the prison system was bursting at the seams and the Government faced a multibillion-dollar decision of having to build extra capacity to keep up, Corrections Minister Kelvin Davis said.
Data showed there were 3099 gang members in prison and 10,260 prisoners in 2017.
"Instead we took a different approach and have safely reduced the prison population by 27 per cent," Davis said.
"But those that commit serious crimes are still being locked up at the same rates, which has meant the proportion of gang members in prison has actually risen."
To help combat the heightened atmosphere and rising violence an extra 64 staff were employed at Auckland, Mt Eden and Christchurch Men's prisons.
An overall budget package will also see 518 staff added to the workforce in the next four years.
"As the most recent National Prime Minister Bill English said, prisons are a 'moral and fiscal failure' and we are committed to addressing the inequality and inequities in our justice system," Davis said.
"But this must not be done at the expense of public safety and tackling gangs is a key priority for the Government."
Davis said that was why police operations, like Tauwhiro which focused on illegal firearms and saw 1670 seized nationwide, were so important.
The upcoming Operation Cobalt will focus on disrupting illegal gang activity across the country.
But National party Corrections spokesman Simon O'Connor claimed the Government wasn't holding gang members to account and said Davis needed to "drop his obsession" with releasing prisoners.
"When violent crime is rising and gang membership has risen by over 40 per cent since Labour came to office, it is clear the Government is not holding gang members to account," he said.
"Labour's soft on crime approach has left New Zealanders feeling unsafe in their communities and their policy of reducing the prison population safely has utterly failed when violent crime continues to explode."
In response, Davis said O'Connor was falsely claiming violent crime was exploding and only made the public "feel more unsafe".
"Politicians do not make decisions about who goes to prison or who doesn't; Judges and the Parole Board do," Davis said.
"Sentencing laws remain the same, and the Courts have all the tools available to them to send people who commit serious crimes to jail as under National.
"If you do the crime, you do the time and this is still happening at similar rates to the previous Government."
Davis said making the bail system more streamlined and providing more accommodation options for people had helped reduce the reconviction and reimprisonment rates.
"There are spikes in certain areas, such as youth crime and gang violence, which is why the Government is responding to those issues clearly and calmly," he said.
"If we had continued down National's path our prisons would be overflowing and we would have been housing people in boarding schools and community halls.
"I doubt many people would say they would feel safe under that approach."
Corrections chief custodial officer Neil Beales said the proportion of gang members in prison had "steadily increased" in the past 30 years.
He said social and welfare issues, employment, education, and health and mental health services needed to combine to reduce the impact of gangs.
"Gang violence and other anti-social activity is not something Corrections can resolve or manage alone," Beales said.
Corrections made steps to discourage prisoners from membership by providing programmes and opportunities to support those disassociating themselves from gangs or gang-related activities, including moving to new areas or accessing services such as tattoo removal.
It also took steps to reduce the risk present in any unit with gang members present and staff were highly experienced at managing accommodation placements, Beales said.
"This is a complex task that requires responding to a dynamic range of issues, including gang tension, on a daily basis.
"Staff anticipate and attempt to resolve problems through the active management of people in prison, and are trained in de-escalation techniques, and interpersonal and tactical communication skills.
"The goal is always to manage a potentially volatile situation in a manner that minimises the likelihood of violent behaviour."
Prevention action could also include unlocking a select number of prisoners at any one time to reduce the risk of gang members coming into contact with one another.