When Joe Neguse discussed his newborn child on the campaign trail in his congressional race in Colorado, he found himself empathizing with constituents concerned about early education for their own children.

In his chats with millennials, the conversation inevitably veered toward their worries about student loan debt, which, as a 34-year-old who went to law school, is a reality for Mr. Neguse as well.

And when he talked to potential voters about his parents’ journey to the United States, people often recalled their forebears’ struggles upon arriving at Ellis Island.

“As I talked about my experiences on the campaign trail based on who I am and my family’s story, it resonated with broad swaths of folks,” said Mr. Neguse, whose parents were refugees from Eritrea. And so it was that Mr. Neguse, a black state regulator, won the election this past week in a House district that is more than 90 percent white and became Colorado’s first black congressman.