Chester Goode might have been holding a grudge after a fight last year at an unlicensed social club tucked in a row of townhouses in Brooklyn. Or perhaps he was losing a game of poker and wanted to rob other gamblers at the illicit operation that drew patrons in flashy cars — and complaints from neighbors.

Investigators were looking at those possibilities on Sunday to explain what led to a shooting that left Mr. Goode and three others dead after a gunfight inside the Triple A Aces Private & Social Rental Place in Crown Heights, said a police official, who requested anonymity to discuss an investigation in its early stages.

Witnesses told the police that Mr. Goode, 37, pulled a gun inside the club just before 7 a.m. on Saturday and told everyone to get down, the official said. He fired a warning shot into the ceiling, and then turned the gun on fellow gamblers packed into the small space.

Before he was shot by a bouncer standing guard, Mr. Goode had killed two of his own acquaintances, the official said.