If neither candidate gets 40 percent, a runoff would be held on September 29.
Whoever wins the Democratic primary for comptroller is favored to win the general election.
The city comptroller is the chief financial officer of the city, analyzing the budget and auditing city agencies. The comptroller is also in charge of the $80 billion municipal pension system.
Liu and Yassky were two of four Democrats competing.