Four men were killed and five others injured in a wild shootout at an after hours gambling den in Brooklyn early Saturday, authorities said.

The shooting unfolded just before 7 a.m. at  the Triple A Aces Private & Social Rental Space on Utica Avenue  in Crown Heights, a source said.

Seven people were shot —six men and one woman—and two others were injured, officials said.

Four men were pronounced dead at the scene, police said.

Medics rushed three other injured victims to Brookdale University Medical Center and two to Kings County Hospital, officials said.

The wounded—two of whom lived out of state—range in age from 32 to 49 years old, police said.

Another victim sustained a leg injury while fleeing the gunfire, police told reporters.

There were reports of additional people transporting themselves to the hospital with minor injuries, though it is unclear how many, authorities said.

“At this point, what it appears to be is an illegal gambling location set up inside that first floor location,” Chief of Detectives Dermot Shea told reporters at a briefing at the scene.

Partiers inside the club had been gambling with cards and dice before the shooting—though there was no evidence of drinking, he said.

The club, which bills itself as a “private and social rental space,” does not appear to hold a liquor license or a business license, online records show.

But the venue’s operation seems to date back at least a decade — the location received two complaints in November 2008 reporting that the first floor had been converted into a nightclub, according to Department of Buildings records.

One caller said the space was being used as a “men’s club,” the complaint shows.

“It seems like this place has been around for a while, operating under the radar,” Community Advocate Tony Herbert of the New York Multi-Cultural Restaurant & Nightlife Chamber of Commerce told The Post.

“There are a host of these kinds of venues that are operating in NYC. Some are law-abiding, others don’t have the proper permits and operate under the radar praying that incidents like this [don’t] happen,” he said in a statement.

Shea praised responding officers in the wake of the “chaotic scene.”

“The individuals that…responded had just made a gun arrest, were processing it and ran back out here,” he said.

At least fifteen rounds were fired in the mayhem, police said.

Two guns, a 9mm and a revolver, were found at the scene.

Police also recovered video footage from inside the illicit gambling club, as well as neighborhood surveillance.

It was not immediately clear what prompted the gunfire, though police do not believe it was gang related.

Two potential suspects were brought in for questioning in the early stages of the investigation, sources said.

Police were also questioning witnesses at the 77th Precinct station house Saturday morning, just a few blocks from where the chaos unfolded.

“We’re trying to piece together exactly what transpired inside that location,” Shea said.

Identities of the victims were being withheld pending family notification.