Delano Martin recalls how he felt in September as he stood next to the coffin of a friend who had been shot dead a few days earlier, one of three people in his inner circle gunned down in a single day. One thought ruled his mind: Shoot the man who had put his friend there.

“All I’m thinking is hate, and anger and revenge, honestly,” Mr. Martin recalled.

Mr. Martin said he abandoned his plan for vengeance after an older man at the funeral gave him a hug and urged him not to retaliate, saying, “Don’t give your life to the prison system.”

But the thirst for revenge, he said, was the driving force behind a recent cycle of gang violence in his neighborhood in Queens — Southeast Jamaica — resulting in 32 shooting victims so far this year, double the number of last year. Murders have more than doubled as well, to 12 from five.

“The mentality has gotten worse,” he said. “People are shooting anywhere, any given time.”

Crime may be at a low ebb in New York, the nation’s biggest city, but gun violence has flared up in some pockets of the metropolis, focusing attention on youth gangs with access to firearms — a combination that often turns deadly.