It was about a minute into Jahana Hayes’s victory speech, which, to that point, consisted of two words — “Wow,” she said twice, gathering her composure — when she recalled the launch of her unlikely campaign for Congress just 102 days earlier, “with no money, no network, no people.”

“People told me I had no chance and I had no business trying to do this,” she said on Tuesday. “We proved them wrong.”

Ms. Hayes, 45, is the newly minted Democratic nominee from Connecticut’s Fifth Congressional District, defeating a more seasoned opponent, Mary Glassman, who had the party’s backing. If she defeats the Republican candidate, Manny Santos, a former mayor of Meriden, in November’s general election, she will become the state’s first black Democrat to serve in Congress.

Her acceptance speech was, in many ways, a metaphor for Ms. Hayes’s life, one that began with diminished expectations: a childhood of poverty in Waterbury, where she lived in public housing and was briefly homeless before becoming pregnant at 17. She then embarked on a career in teaching that led to a National Teacher of the Year award.