Michael E. McMahon, a former congressman and New York City councilman, was chosen as the new district attorney of Staten Island on Tuesday, winning a contentious special election in the city’s most conservative borough.
In defeating Joan Illuzzi, a Republican, Mr. McMahon, a Democrat, takes over a position that drew national attention after a Staten Island grand jury decided not to indict a police officer in the death of Eric Garner, an unarmed black man.
The election was touched off when the previous district attorney, Daniel M. Donovan Jr., a Republican, won a seat in the House of Representatives in May. Mr. McMahon’s victory breaks the Republican Party’s hold on the office and puts all five of the city’s district attorney posts in Democratic hands.
Democrats also declared victory in another election for district attorney, in Nassau County. Unofficial results showed that Madeline Singas, a Democrat who is the acting district attorney, defeating her Republican opponent, Kate Murray, by about 16 percentage points with nearly all precincts reporting.
Ms. Singas was viewed as an underdog against Ms. Murray, the popular Hempstead supervisor, but she gained ground by presenting herself as the candidate best equipped to attack political corruption.
On Staten Island, with 97.5 percent of precincts reporting, Mr. McMahon led 54.9 percent to 44.9 percent. He delivered an acceptance speech shortly after 11 p.m., saying, “We will begin the work tomorrow” in dealing with the problems of drugs, gun violence and domestic violence.
The campaign pitted Mr. McMahon, a familiar face in Staten Island political circles, against an untested opponent in Ms. Illuzzi, who stepped down this year as the senior trial attorney in the Manhattan district attorney’s office.
The candidates clashed little on the substance of criminal justice: Against a backdrop of rising heroin abuse on Staten Island, both pledged an aggressive crackdown on drug trafficking. Neither joined the rising chorus criticizing police tactics in New York and across the country.
Instead, the race turned on preparation and a wide gulf in political stature between the competitors.
Ms. Illuzzi, 53, entered the race late and struggled to assemble a political operation to compete with Mr. McMahon’s. A career prosecutor who had never run for public office before, Ms. Illuzzi was best known for her leading role in the trial of Pedro Hernandez, who was accused of killing Etan Patz, a 6-year-old who disappeared in 1979.
After the case ended in a mistrial, Ms. Illuzzi left her post to seek the Republican nomination for district attorney on Staten Island.
She proved to be a dogged campaigner, consistently attacking Mr. McMahon, 58, for his lack of experience as a criminal lawyer, and branding herself as a “prosecutor, not a politician.”
But Mr. McMahon’s deeper political training was on display throughout the race: He raised far more money for his campaign than Ms. Illuzzi did and collected strong support from law enforcement unions.
Criticized for his thin prosecutorial credentials, Mr. McMahon staked his candidacy on the argument that Staten Islanders needed a practiced political hand to advocate for their interests before state and city government.
That line of reasoning prevailed with a Staten Island electorate known for its traditional law-and-order values, and for its suspicion of more liberal New York City politicians outside the borough.
Two other elections for district attorney in New York City held little suspense: In Queens, Richard A. Brown, a Democrat who has held the prosecutor’s post since 1991, easily won another term.
And in the Bronx, Darcel D. Clark, a Democrat, sailed into office as the county’s new district attorney.
A former justice of the State Supreme Court, Ms. Clark was nominated for the post by county Democratic leaders when the incumbent district attorney, Robert T. Johnson, dropped his bid for re-election after the Democratic primary.