WARSAW — In one of Warsaw’s most run-down neighborhoods, where glittering new towers across the Vistula River shimmer in the distance but many people live in graffiti-clad buildings largely left to crumble since World War II, the Polish rapper Piotr Szot had a message for the crowd.

The city’s elite may deride supporters of the country’s governing party, Law and Justice, and its candidate for mayor of Warsaw, Patryk Jaki, as a low-class hoodlum “from the block.”

Good, he said. That means Mr. Jaki is one of them.

“People from the town hall keep humiliating and spitting on us,” Mr. Jaki, a 33-year-old firebrand, told the crowd recently when he took the stage later in the evening. “They don’t want us to take over the town hall, because they’re afraid of what we’ll find there.”

The emotional appeal to historical grievance and the targeting of voters who feel left behind despite Poland’s booming economy are strategies that worked well for the right-wing and populist Law and Justice party when it swept to power in 2015 on the strength of the rural vote. It is hoping to use a similar strategy to make inroads in the nation’s largest urban centers and powerful provincial councils.