Ms. Malliotakis, 36, has positioned herself as the antithesis to Mr. de Blasio, a Democrat she accuses of neglecting average New Yorkers and letting quality of life deteriorate in the city, and as a more formidable candidate than Mr. Massey, who she has suggested is bland and less capable of courting Democrats in a general election. For any Republican to win, he or she would need a considerable number of city voters to cross party lines, given that Democrats hold a six-to-one registration advantage.

“I’m somebody who the Republican Party has never offered before,” she said on Monday, citing her personal biography as a product of Staten Island public schools and the daughter of a Cuban mother and a Greek father.

It will be an uphill battle.

Ms. Malliotakis raised $94,000 in the latest matching period, her first. Only about a third of that counts toward the threshold for the city’s generous public matching program, which she hopes to qualify for. (To get into the program, a candidate for mayor must raise at least $250,000 from at least 1,000 contributors inside the city, and only the first $175 of each contribution counts toward the threshold.)

She also must contend with her record in the Assembly, where she is in her fourth term representing parts of Staten Island and southern Brooklyn. Recently, Ms. Malliotakis sued the city unsuccessfully to halt the destruction of records from its municipal identification program. And she has embraced the Trump administration’s idea of withholding federal funds from New York City until it cooperates with immigration agents on deportations.

In recent days, Ms. Malliotakis has tried to clarify her stance on immigration, saying she believes city agencies are right not to ask about immigration status. “A victim of a crime wants to come forward to the Police Department, they should feel comfortable doing so,” she said in an interview. “We want to continue that.”