He appeared to pit the city’s long-running problems of affordability, gentrification and inequality against the city’s long-running tradition of welcoming newcomers and outsiders of all stripes.

[Mr. Adams sparked a conversation on what makes someone a New Yorker.]

But Mr. Adams is hardly the first person in New York to tread down this path.

In June, City Councilwoman Laurie Cumbo renamed a street corner in Brooklyn after Christopher Wallace, the rapper better known as Notorious B.I.G., who died in 1997.

“Why this street co-naming is important is because while everybody is coming to Brooklyn, New York, they want to erase the history,” she said at the time. “They want to put up new cafes and boutiques and to push us out of our community.”

In 2018, protesters said gentrifiers in Crown Heights were partly to blame for the fatal police shooting of a man with mental illness.

“You are visitors in our communities,” Hortencia Peterson, a protester, told a crowd at one demonstration. “Stop calling 911. Blood is on your hands.”

Mr. Adams, a retired police captain and a former state senator, was elected borough president in 2013 and has talked openly about wanting to run for mayor in 2021. His comments on Monday might help him gain support from residents who are frustrated over the cost of living in New York City.