With 50 percent of precincts reporting, City Councilwoman Letitia James and state Sen. Daniel Squadron both have about 34 percent of the vote.
A runoff election is required when no candidate gets 40 percent of the vote. The runoff is scheduled for Oct. 1.
Five Democrats were on the primary election ballot. The candidates in Tuesday's election also included college professor Catherine Guerriero, former deputy Public Advocate Reshma Saujani, and Sidique Wai, a community relations worker at the New York Police Department.
The public advocate works to make sure residents are best served by city government.
The winner will go onto the Nov. 5 general election.