“I don’t think that’s a label she can dispute,” Robert F. Holden , a councilman from Queens who endorsed Ms. Katz, said of her being a machine politician. “But I don’t think Melinda checked with the county as to whether she would run. Melinda does what she feels is right for her constituents.”

Ms. Katz, 53, a mother of two boys, lives in the same house in Forest Hills that she grew up in. When she was 3, her mother was killed by a drunken driver and she and her three siblings were raised by her father, David Katz, the founder of the Queens Symphony Orchestra.

Being raised by a single father was not the norm then, and Ms. Katz remembers feeling like a victim for much of her childhood. “I always felt like something wrong happened and it wasn’t fair,” said Ms. Katz. “I now realize people go through a lot worse things.”

Ms. Katz lived down the street from Alan G. Hevesi, then just at the beginning of a 35-year career in public service as an assemblyman, the New York City comptroller and the state comptroller for four years, before leaving office in disgrace after pleading guilty to fraud.

Ms. Katz volunteered for his victorious campaign for city comptroller, and he decided to support her for his old Assembly seat. The county organization threw its weight behind a different candidate, but Ms. Katz knocked on doors and pulled out a tight victory.

She unsuccessfully ran for Congress in 1998, losing the Democratic primary to Anthony Weiner, and also fell short in the 2009 primary for city comptroller to John Liu.

When Ms. Katz announced last year that she would run for district attorney, critics said that she had never expressed much interest in criminal justice and was just looking for her next job because she is barred by the term-limits law from running for a third consecutive term as borough president.