Carl Wilson held a lead Tuesday night in the special election for a City Council seat on Manhattan’s West Side against Lindsey Boylan, in what has shaped up as a proxy battle in the ongoing power struggle between Mayor Mamdani and Council Speaker Julie Menin.

Due to the city’s ranked choice voting system, the final results won’t be immediately released, but Wilson had a nearly 20% lead over Boylan in the first round — and he declared victory.

The race for the Council seat vacated by now-state Sen. Erik Bottcher became a front in the power struggle between Mamdani and Menin, and it appeared late Tuesday that the mayor was headed for a humbling result in one of his first attempts to leverage his political capital in a local race.

Menin said on social media Tuesday night: “Tonight, we had a resounding victory by electing Carl Wilson as our next City Council Member.”

“While we are waiting to count every vote, the numbers tonight are clear,” Wilson said in a statement. “District 3 has backed our message of affordability, compassion, and fighting for what matters in our community, and shown that local voices and neighborhood leadership still matter most.”

In the race to fill the Council seat for District 3 — which includes the West Village, Chelsea and Hell’s Kitchen — Mamdani backed Boylan, a fellow Democratic Socialists of America member and an ally during his mayoral campaign against Andrew Cuomo.

Boylan was the first woman to accuse the ex-governor of sexual harassment, and a super PAC tied to his allies has spent six figures whacking her over the last week, New York Focus first reported.

Menin has supported Wilson, Bottcher’s former chief of staff, who had his ex-boss’s blessing in the race. Rep. Jerry Nadler, Rep. Nadia Velazquez and City Comptroller Mark Levine also backed Wilson.

The mayor’s involvement was a gamble, as Boylan did not have the same ties to the local political establishment as Wilson. Boylan had mounted two unsuccessful campaigns before, for Congress and for Manhattan borough president.

At a campaign stop early Tuesday morning, Mamdani praised Boylan for standing up to Cuomo.

“In that courage, we see more of what we need in our politics,” the mayor said. “We need someone who is willing to tell the hard truths, someone who is willing to actually speak up for working people, so we’re so excited to be here alongside you.”

The race came amid a broader power struggle between the two sides of City Hall early in both Mamdani and Menin’s leadership, but the election will also have a more immediate impact.

After the mayor vetoed a buffer zone bill for schools last week, Menin is assessing her options on an override, for which she needs four more votes. Of the contenders for the open Council seat, only Wilson said he would vote against the mayor.