At ten-twenty, a group of people appeared onstage, carrying the blue banner of the Working Families Party, which had endorsed Nixon, Teachout, and Williams. By this time, all three seemed to be losing, but the message from the stage was one of victory. Maurice Mitchell, the national director of the Party, who was wearing a black “Abolish ICE/Cynthia for New York” T-shirt, a denim shirt, and a fedora, said, “People, you defeated the I.D.C.! Tonight, we made history!” He was followed by Bill Lipton, the state director of the Party, who said, “The center of gravity has shifted, and Andrew Cuomo will face a radically different Albany.”

In a very different part of Brooklyn, in East Williamsburg, in a very different kind of bar—a converted warehouse with a vast beer garden and a giant white tent in the back—the mood was different: rather than defiantly triumphant, it was incredulously triumphant. Here was the victory party for Salazar. The crowd was younger and more homogenous: whiter, with many more beards. Clumps of people who had gathered around large picnic tables in the garden were celebrating, hooting and clapping, each group to its own beat. Campaign staffers shrugged their shoulders when I asked who was being applauded. Earlier, I was told, the crowd had been united in the union song “Solidarity Forever,” sung to the tune of “The Battle Hymn of the Republic,” with many participants learning the lyrics off their phones in real time.

Before I biked from the Nixon/Teachout/Williams party to the Salazar one, I read a Facebook post by the political scientist Corey Robin: “With 84% of the ballots counted, Salazar has expanded her lead to 14 points. If she wins this, and it seems that she will, it will be a massive victory for grassroots organizing—and the awesome leadership skills of Michael Kinnucan—over major media pushback.”

I found Kinnucan in the beer garden. “Everyone thought I was the campaign manager because I’m a man,” Kinnucan said. The actual campaign manager, Tascha Van Auken, was standing next to him. “I did what she told me,” he said.

Before this race, Van Auken had never been a campaign manager. She told me that the first thing she knew of electoral politics was “The West Wing,” a show that portrayed the people of politics as peculiarly erudite and quick-thinking. This was what she assumed a politician was, until she got a job with the Barack Obama campaign in its final two months, not quite ten years ago. It turned out, she said, that “you don’t have to be a political historical genius” to be a politician, but you do have to know how to talk to people. She volunteered for Bernie Sanders ahead of the Democratic primary in New York in 2016; last year, she joined the D.S.A. and was soon running its electoral program.

At Salazar’s victory party, in East Williamsburg, Brooklyn, the crowd was incredulously triumphant. Photograph by Scott Heins / Getty

The socialist agenda for New York is straightforward. “We need to take care of each other,” Van Auken told me. “We need to have universal health care. That’s just the dumbest thing.” She rolled her eyes at having to speak of something so obvious. “We need to make sure we don’t have thousands of homeless children in the city. We need affordable housing for everybody.” Issues of health care and housing are, in fact, on the state’s docket. A bill expanding Medicare has long been struck down by the Senate every time it comes up, and some rental regulations that have an impact on Salazar’s district are expiring next year. And then, Van Auken said, there are “the things we define as democracy: access to political engagement and the ability to live and thrive to be able to have access to political participation, to have time to do it.” Van Auken looked like she’d had as little sleep and as many drinks as anyone who had scored a victory that day, but her definition of democracy was clear, thoughtful, and well rehearsed: “If you are working two jobs, you don’t have the time.”

State Senate District Eighteen includes parts of Williamsburg, Bushwick, and Cypress Hills: neighborhoods in different stages of gentrification. The crowd whose arrival often heralds gentrification—the young bearded types at the party—had worked on the campaign. Van Auken drew a distinction between them and real-estate developers who aim to profit from rising real-estate prices. The hipsters who come to the neighborhood for the “right reasons,” as Van Auken put it, are actually working to keep older residents safely in their homes.

The Salazar campaign walked the walk: three out of its four staff members immediately unionized and negotiated a good wage, by campaign standards. The campaign also didn’t hire any political consultants. It did, however, invest in door-to-door campaigning. This probably proved more effective than anything else. Over the past few weeks, Salazar has come under scrutiny: she self-identified as a working-class immigrant from Colombia and as a Jew, although she was born in Miami and was known as an evangelical-Christian anti-abortion activist during her time as an undergrad at Columbia University, even appearing on Glenn Beck’s talk show. There was also a bizarre incident involving Keith Hernandez’s ex-wife, an arrest for attempted identity theft (the charges were dropped), and a subsequent lawsuit that added fuel to the tabloid interest in Salazar. But the campaign discovered something that the American President has known for a long time: communicating with people directly, whether by Twitter or by going door to door, takes precedence over anything that’s reported in the media.

Of course, it also helped that New York’s favorite insurgent candidate was campaigning for Salazar: fellow D.S.A. member Alexandria Ocasio-Cortez, who defeated a nineteen-year Democratic incumbent in the congressional primary in June. And it helped that the D.S.A. had been laying organizing ground for Salazar’s campaign.