“People like us, people in rural New York, we are not people who respond to this part of American culture,” Mr. Benjamin said.

The criticism of Mr. Delgado has thrust historically fraught topics of race and identity into the forefront of an election that was already slated to be one of the most competitive in this November’s midterm elections. Mr. Delgado, who is black, said he believed the attack on his lyrics is an attempt to “otherize” him, particularly because he’s trying to become the first nonwhite candidate to represent the area in Congress. A poll commissioned by the Democratic Congressional Campaign Committee recently showed him leading Mr. Faso.

New York’s 19th Congressional District voted for President Barack Obama in 2008 and 2012, but went for President Trump in 2016. About 83 percent of the voters in the 19th are white, making it among the whitest congressional districts in the country.

[Here’s what’s coming up next on the primary calendar.]

The songs he recorded include frequent use of the racial epithet and a few references to sexual acts. Mr. Delgado said his words were appropriate considering the context of his art at the time. He also cited contemporary rap artists such as Kendrick Lamar, J. Cole, and Lauryn Hill as inspirations for his political outreach, since much of their music focuses on giving voice to those who are typically unheard.

“It was different contexts, different tactics, but same desires and same outcomes,” Mr. Delgado said of his old music. “Issues like income inequality, issues like gender equality, issues like the pollution of our environment and climate change — these are all issues that I talked about back then as an artist that I’m now talking about” as a candidate.

Referring to Mr. Faso, Mr. Delgado said, “In his dated mind-set, he thinks it’s accurate to suggest that if you’re black or if you’re of a certain race, you can’t be of this community,” Mr. Delgado said. “But I believe the community of people who are grounded in love and unity far outweigh the community of people he’s speaking to.”