Voters in Detroit on Tuesday narrowed their choices for the city’s next leader to two: Mike Duggan, the incumbent mayor who has overseen the city as it has emerged from bankruptcy, and Coleman A. Young II, the son of Detroit’s longest serving mayor.

With a vast majority of precincts counted, Mr. Duggan, 59, who was elected in 2013 as the city’s first white mayor in four decades, had a wide lead among eight candidates in the nonpartisan primary late Tuesday. Mr. Young, 34, a state senator whose father was Detroit’s first black mayor, was running a distant second. The two men, who are Democrats, will face each other in a general election on Nov. 7, The Associated Press said.

The election will be a test of disparate issues in a city that, in a matter of only a few years, has experienced the nation’s largest ever municipal bankruptcy, a downtown building boom, and a struggle to rid itself of thousands of vacant, crumbling buildings.

Critics had predicted that the city might take years to emerge from bankruptcy, and that any glimmer of a renaissance would take even longer. But signs of improvement have piled up. Streetlights are on. Police response times have dropped. And some home sales prices have risen.

“This city is coming back to the way it was before,” said Rondo Johnson, 91, who has lived in Detroit for decades. “It’s certainly better than it was five years ago, but there’s more to do.”

Some residents said race will be a factor in the election to lead this city, which is 82 percent black. Mr. Young’s father, who died in 1997 after serving as mayor for two decades, is widely remembered as giving African-American residents a voice at this city’s municipal building, which now bears his name, and through the ranks of the city departments.

“You can’t talk about the American political story and race not be at the center of it,” Mr. Young, the candidate, said in an interview in July. “I’m not against Mike Duggan because he’s not black. That’s God’s plan. But I am against someone who fundamentally is clueless on issues that are affecting African-American people.”

At the center of Mr. Young’s campaign is the notion that the city’s improvements only have benefited areas like downtown, leaving other neighborhoods to wrestle with high crime, blighted homes and empty blocks.

But some black leaders — including the Black Slate, a longstanding political group, and some officials who had worked with Mr. Young’s father — have lined up behind Mr. Duggan. Mr. Duggan, who drew attention in May for a speech he made about the role of racism in the Detroit’s history, said in an interview before the primary that everyone “had their own feelings” on the issue of race and where it should fit into this election.

Mr. Duggan said he believed that “the great majority of people who live in the city care more about results than race.” He added, “I’m about to get a report card.”