For black voters unsettled by the Bloomberg era of law enforcement, Mr. Thompson occupies an intriguing place in the campaign. He has defended elements of the stop-and-frisk policy as effective and stops short of the call to abolish it advocated by a Democratic rival, John C. Liu, the city comptroller, positions that have earned Mr. Thompson the support of major police unions.

But he has made clear he would replace the police commissioner, Raymond W. Kelly, overhaul the stop-and-frisk strategy to ban racial profiling, and limit reliance on the practice by hiring 2,000 more officers and putting more experienced ones in high-crime areas.

On Sunday, though, he talked about the issues in human terms, as a father and a husband. Mr. Thompson, the son of a Democratic judge in State Supreme Court and a schoolteacher, acknowledged that his biography did not put him in the same shoes as many black and Latino men across the city.

“I am the son of the struggle before me,” he said. “And although it has not ended, I have lived in the blessing of its success so far.”

But, invoking the “dreams of our fathers” and “dreams for our sons,” he said he felt compelled to speak out after the acquittal of Mr. Zimmerman. “When the rules of society — that we call and honor as the law — allow even one of those dreams to be snuffed out in anger and fear without consequence or action, those rules fail us all,” he said.

Inside the church, where the mostly black congregants said they had anticipated a tepid speech from another politician, there was a mixture of surprise and admiration.

“I wasn’t expecting that at all,” said Karen Khan, 52, who teaches middle school in Brooklyn, and had never known Mr. Thompson to talk about race. “I thought it was going to be one of those speeches designed to pacify the issue. Sweep it under the rug — O.K., let’s move on.”