“There’s an overwhelming disenchantment with him in this community,” said Keegan Stephan, a veteran activist who has taken part in the protests against Mr. Thompson. “It would be wrong to suggest he hasn’t done good things, but many people who supported him at first are criticizing him now.”

At the heart of this community is a small and diverse array of grass-roots groups whose members have staged protests across the city and have undertaken a scathing social-media campaign against Mr. Thompson, a Democrat, and his office. That campaign, laced with caustic Twitter posts and videos on Facebook, has been inspired in part by Mr. Gurley’s family, which has bitterly attacked the district attorney, and has found support among several officials, like State Assemblyman Charles Barron, a firebrand Democrat from Brooklyn.

In recent weeks, the demonstrators have started to compare Mr. Thompson to Anita Alvarez, the state’s attorney in Cook County, Ill., who lost her job over the case of Laquan MacDonald in Chicago, and Tim McGinty, the Cleveland prosecutor who was voted out of office for his handling of the death of Tamir Rice. Branding Mr. Thompson a sellout and a traitor, they have begun to issue demands that he resign.

There would seem to be an irony in liberal protesters’ openly condemning a liberal district attorney. But those who have found fault with Mr. Thompson — including public defenders who have joined the activists in the substance, if not style, of their complaints — have claimed that he applied standards of justice for the former officer, Peter Liang, in Mr. Gurley’s death that were different from those used in the cases of ordinary people, many of whom were black or Hispanic and charged with minor crimes.

“Thompson sought to afford access to meaningful justice for Mr. Liang,” two officials of the Legal Aid Society wrote in an opinion article shortly after the district attorney recommended probation for Mr. Liang. “Sadly, our clients are not given the same consideration.”