CHICAGO — Brandon Johnson had a problem. In a crowded Chicago mayoral race full of established liberal politicians — a sitting congressman, the incumbent mayor, two City Council members — many voters had never heard of Mr. Johnson, a county commissioner from the West Side.But he had something those other contenders did not: the Chicago Teachers Union.Loved and loathed, the teachers’ union has emerged over the last dozen years as a defining voice on Chicago’s political left, putting forth a progressive vision for the city that extends well beyond its classrooms. After highly public fights with the last two mayors that led to work stoppages, union leaders see in Mr. Johnson a chance to elect one of their own, a former teacher who shares a goal of rebuilding Chicago by spending more on schools and social programs.Boosted by the union’s endorsement — and perhaps more critically, its money — Mr. Johnson, a paid C.T.U. organizer since 2011, faces Paul Vallas, a former public school executive who has far more conservative views on policing and education, in an April 4 runoff. With the two finalists coming from opposite ideological ends of the Democratic Party, the runoff will test whether voters prefer Mr. Vallas’s plan to crack down on crime, hire more police officers and expand charter schools, or Mr. Johnson’s call to spend more on public education and social services, add new taxes and look to neighborhood schools as an engine for broader social change.“Our school communities really are a microcosm of all of the political problems that exist,” said Mr. Johnson, who taught social studies to middle schoolers in Chicago’s Cabrini-Green public housing complex, and who frequently refers to the time a student raised her hand and told him that he should be teaching at a good school, not hers.“It was in that moment where I recognized how much our system has failed, where our students and our families can recognize quality, but do not believe that they deserve it,” Mr. Johnson said in an interview. “And so where I am today is the result of that moment.”Mr. Johnson, second from right, traveled to Selma, Ala., this month as a guest of the Rev. Jesse Jackson, seated, for the annual commemoration of Bloody Sunday. Andi Rice for The New York TimesMr. Johnson, who is on leave from his job with the teachers’ union, entered the field in October with low name recognition and a daunting path to electoral relevance. One early poll showed him with about 3 percent support. But as the weeks went by, he shot up in the polls, introducing himself to voters with 15-second TV spots and surprising competitors who focused their early attack lines on better-known candidates.Mr. Johnson, 46, who is Black, came in second in a first round of balloting last month. He performed especially well in liberal, mostly white wards along the city’s northern lakefront and in areas northwest of downtown with large Hispanic populations. Mr. Vallas, 69, who is white, came in first place, running up large margins around downtown and also carrying majority-white areas on the Northwest and Southwest Sides. Mr. Johnson’s rapid ascent was fueled by his gift for retail politics, a message that resonated with the city’s sizable bloc of liberal voters and large donations from labor unions. State records show that of the more than $5.6 million in contributions Mr. Johnson’s campaign reported between the start of 2022 and earlier this month, more than $5.2 million came from organized labor, including significant sums from the Chicago Teachers Union, the American Federation of Teachers, the Illinois Federation of Teachers and branches of the Service Employees International Union. Since last fall, the Chicago Teachers Union and its political action committee have contributed more than $1 million to the Johnson campaign.Stacy Davis Gates, the president of the Chicago Teachers Union, which has more than 20,000 members, said there was no expectation that Mr. Johnson would be in lock step with the union if elected. But she said the possibility of having a mayor who understood the struggles of classroom educators and would listen to their concerns had motivated teachers to support him.“It’s been difficult for my members over the course of these few years,” said Ms. Davis Gates, whose union engaged in work stoppages in 2012, 2019 and, after a dispute with Mayor Lori Lightfoot over Covid-19 protocols, again in 2022. “They have not been respected or treated as the stakeholder that they are in this city,” Ms. Davis Gates added. “They’re looking for partnership.”Paul Vallas, a former public school executive who has far more conservative views on policing and education, will face Mr. Johnson in the April 4 runoff. Taylor Glascock for The New York TimesMr. Johnson’s close ties to the teachers’ union can be helpful: Liberal politicians covet the union’s endorsement, and in a 2019 poll reported by The Chicago Sun-Times, 62 percent of voters said they had a favorable opinion of C.T.U.But among Vallas supporters, Mr. Johnson’s C.T.U. ties have become a point of criticism. As a C.T.U. member and organizer, Mr. Johnson helped the union exert its influence and challenge the mayor on several issues.“He’s going to do what the union wants to be done,” said Gery Chico, who led Chicago’s school board when Mr. Vallas was the chief executive of Chicago Public Schools, and who has endorsed Mr. Vallas for mayor.As the C.T.U.’s political influence has grown over the last 12 years — first as a chief antagonist of Mayor Rahm Emanuel, who oversaw school closures, then with Ms. Lightfoot, who fought with the union about work conditions and Covid reopenings — some have questioned its role in Chicago politics. In an interview in 2021, Ms. Lightfoot suggested that both the C.T.U. and the local chapter of the Fraternal Order of Police, which has endorsed Mr. Vallas and whose leaders often support Republicans, had moved beyond the traditional role of labor unions and become more overtly political, creating inevitable conflict.Mayor Lori Lightfoot conceded on Feb. 28 after failing to make the runoff in the first round of balloting.Jamie Kelter Davis for The New York TimesMr. Johnson, the son of a pastor, plans to end his membership in the teachers’ union if elected mayor. When asked whether there were areas where he expected to have to tell the union no, Mr. Johnson did not provide specific examples.If elected mayor, “my responsibility is to the entire city of Chicago,” he said. “And look, I’m getting new friends every single day. And I have a bunch of old friends that we will have to have hard conversations with.”Mr. Vallas has repeatedly criticized the C.T.U. and tied Mr. Johnson to the union’s reluctance to return to in-person instruction during the pandemic.“Brandon was in part responsible for the shutting down of one of the poorest school systems in the country, with devastating consequences,” Mr. Vallas said during a recent debate, adding that “if you look at the crime statistics, and you look at the violence, and you look at the dislocation and declining test scores, you can see the results.”During the campaign, Mr. Johnson has described a Chicago dogged by inequality, plagued by violence and constrained by schools that lack the resources they need. That worldview, he said, was shaped by his time in Room 309 of Jenner Academy in Cabrini-Green, where he taught from 2007 to 2010, a time when many of his students’ homes were being demolished as part of a citywide push to knock down public housing high-rises.“The children were waking up to bulldozers — literally just bulldozers staring at us all day long,” Mr. Johnson said in an interview in Selma, Ala., where he traveled this month as a guest of the Rev. Jesse Jackson for the annual commemoration of Bloody Sunday. “And there were families where their homes had already been dismantled, so we had students who were taking two buses and a train to come back to the school.”In Cabrini-Green, former colleagues said, Mr. Johnson was a rare Black male teacher at a school where almost all of the students were Black. He revived defunct basketball and flag football teams, gaining a reputation as a nurturing coach with a competitive streak. And he was known as an engaging but demanding teacher who asked students to dress up on days when they gave a presentation.“The discipline that he showed and the love that he showed for the kids, the kids respected him,” said Pat Wade, a school security officer and coach who worked with Mr. Johnson in Cabrini-Green. “And they worked hard because of what he gave to them. A lot of people can’t do that.”Mr. Johnson meeting with voters on the South Side this month.Jim Vondruska for The New York TimesMr. Jackson, a Chicagoan who has endorsed Mr. Johnson’s bid for mayor, emphasized the candidate’s record of working with children in a city where many young people lack opportunity and are caught up in the criminal justice system.“These troubled youth in Chicago,” Mr. Jackson said, “he represents a face of hope for them.”But Mr. Johnson has faced criticism for his views on crime, the biggest issue in the campaign. In 2020, he described defunding the police as a political goal and supported a County Board resolution to “redirect funds from policing and incarceration to public services not administered by law enforcement.”As a candidate, Mr. Johnson has tried to distance himself from questions about defunding, and he has called for hiring more police detectives as well as increased funding for mental health services.Mr. Johnson said he saw similarities between the criticisms he has faced on policing and those leveled against Harold Washington, Chicago’s first Black mayor, 40 years ago.“This is not new to the city of Chicago: Yet another attack on a Black man as an elected leader who is committed to investing in people,” Mr. Johnson said. But just as his ties to the teachers’ union have been seized on by his political opponents, skepticism about Mr. Vallas’s endorsement from the police union could provide an opening for Mr. Johnson.Scott Lewis, a North Side resident, said he agreed with Mr. Vallas that crime was out of control. But he still planned to vote for Mr. Johnson.“Compared to the others, he seems a little too cozy with the F.O.P. for my taste,” Mr. Lewis said of Mr. Vallas. “The police do have an important role, but I think reform is important.”Robert Chiarito More