A day after the primary election, two women are holding on to razor-thin leads for New York City Council seats. But even if they both survive, next year’s City Council will have fewer women, down from 13 seats to 12 in the 51-member body.

In one of the races, Diana Ayala has a narrow lead over Assemblyman Robert Rodriguez in the Democratic primary for the East Harlem and South Bronx district held by outgoing Council Speaker Melissa Mark-Viverito. In the other, New York City Councilwoman Margaret Chin is barely ahead of Christopher Marte, a little-known challenger who came close to completing an upset in lower Manhattan. The races are the only two primary matchups in the City Council that have yet to produce a clear winner.

RELATED: New York City's 2017 primary election results

Ayala is up by just 122 votes over Rodriguez, as of the latest count from the New York City Board of Elections at 12:39 a.m. on Wednesday. With 98 percent of voting scanners reporting, Ayala campaign spokesman Matt Rey was confident that she would hold onto the lead.

“We’re going to make sure every vote is counted,” Rey said, “but there’s no doubt in my mind – and really anyone’s mind – that this margin is too great to overcome with the amount of paper ballots that are out there.”

Ayala’s campaign declared victory late Tuesday night, but Rodriguez’s campaign issued its own statement saying “it is premature for anyone to declare a victory.” Rodriguez, who is a sitting member of the Assembly, expects there to be a recount, which should take a week, according to a spokesperson for the campaign.

Ayala, who serves as deputy chief of staff for City Council Speaker Melissa Mark-Viverito, had the speaker’s endorsement for the 8th District. Mark-Viverito, who is term-limited, has been outspoken about the need for more female representation in the council, launching a campaign to have 21 women on the council in 2021.

Joining her for that campaign launch was City Councilwoman Margaret Chin, who is facing a close race of her own for reelection. As of early Wednesday morning, Chin was ahead of Marte, a community activist, by just 200 votes in a race that was also too close to call.

Chin’s campaign could not be reached for comment, but Marte said he was optimistic. “We just want to see where the votes lie. I think 200 votes is a small margin, and it’s definitely doable,” he said. Marte said he expects the Board of Elections to do a recount after the votes are officially certified sometime next week. If he were to overcome the deficit, Marte would be the only challenger to defeat an incumbent in this year’s primaries.

Of the 13 women currently serving in the New York City Council, four are prevented from seeking reelection due to term limits, including Mark-Viverito. A fifth, Councilwoman Julissa Ferreras-Copeland, chose to retire at the end of this term, surprising many who had thought she would run for speaker. Six female council members not bound by term limits also faced primary challenges – including Chin – casting doubt on the Council’s ability to maintain or improve upon the number 13.

Several female candidates scrambled to fill the open seats left by women council members, and a few were successful. Carlina Rivera will likely replace Rosie Mendez, as she faces perennial Republican long-shot Jimmy McMillan in the November general election. Alicka Ampry-Samuel will replace Darlene Mealy in Brooklyn. Adrienne Adams also won the Democratic nomination for Ruben Wills’ vacated Queens seat, and she is all but certain to beat GOP candidate Ivan Mossop in November.

However, two seats will be filled by men in the upcoming term, with state Sen. Ruben Diaz Sr. set to succeed Annabel Palma in the Bronx and Assemblyman Francisco Moya replacing Ferreras-Copeland in Queens.

RELATED: The best New York City Council members

Five other sitting women council members managed to defeat their challengers, including Laurie Cumbo and Helen Rosenthal, who faced spirited primary challenges. Nonetheless, the results of the Democratic primaries on Tuesday show that there are all but certain to be fewer women in the upcoming term.

Other female candidates ran promising campaigns but were unsuccessful, including Marjorie Velazquez, who was running to replace the term-limited Jimmy Vacca in the East Bronx and had garnered support from a number of female council incumbents. Assemblyman Mark Gjonaj won that race instead. Pia Raymond, Marti Speranza, Alison Tan also all ran strong campaigns but ultimately lost to male candidates.

Even if the council members facing male Republican or third party candidates manage to defeat their opponents in November, the number of women sitting in the Council will shrink to 12, if not even lower. In a city of over 8.5 million, women account for more than 50 percent of the population, with the city Department of City Planning estimating that there are 400,000 more women than men. But with the number of women in the Council likely to decrease by at least one, roughly 24 percent of New York’s representative body will be female.

Moreover, there are no women running to replace Mark-Viverito in the Council speaker race. The city is also likely to have a male mayor, as Mayor Bill de Blasio is the heavy favorite to win November’s general election against Republican candidate Nicole Malliotakis, and New York City Comptroller Scott Stringer is likely to win another term. Despite the presence of a female public advocate, two female borough presidents and a number of female agency heads, city leadership will be overwhelmingly male in the upcoming year.

Editor's note: This post has been updated with comments from council candidate Christopher Marte.