Assemblyman Daniel O’Donnell is a longtime Manhattan legislator with a solid record that includes helping pass the state’s landmark gay marriage law.

Since the public advocate serves best as a foil for the city’s mayor, Councilman Eric Ulrich — the race’s only prominent Republican , though a moderate one — might seem to be an obvious match against Mr. de Blasio, a liberal Democrat. He may even benefit from a divided Democratic vote. But while he brings years of experience in city government, on the issues that matter most — housing and mass transit — Mr. Ulrich is unlikely to be a champion.

The best candidate to hold Mr. de Blasio accountable and to press for reforms is Jumaane Williams, a veteran city councilman with a record of accomplishment and a steadfast willingness to stand up to powerful interests on behalf of New Yorkers.

Mr. Williams, a former tenant organizer from Brooklyn first elected in 2009, helped build the movement to end the overuse of police stops under Mayor Michael Bloomberg, a major injustice from which the city is still recovering. Along with Councilman Brad Lander, Mr. Williams sponsored the Community Safety Act, which established an inspector general for the Police Department.

Mr. Williams has stood up to Mr. de Blasio as well, voting against the mayor’s housing plan, arguing that it could worsen the displacement of low-income residents, for example. He has also been increasingly outspoken about the mayor’s record on police reform, pressing Mr. de Blasio to exercise more oversight and accountability over the Police Department.

He has won passage of more than 50 bills, far more than many of his colleagues. He has also been arrested while protesting nearly a dozen times. Both facts are keys to understanding Mr. Williams, a hard worker passionate about making government work better for the people it serves. He sponsored hard-fought legislation to require more safety training for construction workers, after a series of high-profile deaths in the industry. He successfully pushed legislation to strengthen city enforcement against tenant harassment, and another bill to prevent landlords from discriminating against domestic violence survivors. While Mr. Williams has said he is personally opposed to abortion, he firmly supports abortion rights, and has voted consistently on the issue.

On gay rights, Mr. Williams has evolved. Though he once said he believed marriage was between a man and a woman, he has in recent years become a dependable supporter of L.G.B.T.Q. rights, including marriage equality.