It was election night at La Boom, a Queens nightclub, and Tiffany Cabán’s supporters had something to say.

“Black Lives Matter!” they shouted, an extraordinary cry at the victory party for a district attorney candidate. “Black Lives Matter!”

Such was the scene as the night’s tally ended with Ms. Cabán 1,090 votes ahead of Borough President Melinda Katz in the Democratic primary. The final toll won’t be known until at least next week , when absentee and other paper ballots are counted.

If Ms. Cabán’s lead holds, New York is likely to be added to the list of cities that have elected district attorneys who want to remake the criminal justice system to undo two decades of policies that led to the imprisonment of hundreds of thousands of black and Latino Americans, too often for minor crimes and drug-related offenses.