They will face off Nov. 8 to determine who will succeed Mayor Charlie Luken (search), who declined to seek a second four-year term.
With all precincts reporting, unofficial returns from the Hamilton County Board of Elections showed Pepper and Mallory each with about 31 percent of the vote.
Former Councilman Charles Winburn, the lone Republican running in the heavily Democratic city, was third with 21 percent. Vice Mayor Alicia Reece, a Democrat, got 15 percent.
The independent challengers — Justin Jeffre of the "boy band" 98 Degrees; retired small businessman Sylvan Grisco; and Sandra Queen Noble, a security guard — combined for just over 2 percent.
"We're very excited to get one step closer to being able to move this city in a new direction," Pepper said.
"I think people are optimistic about where we need to take the city. They're concerned about where we are, and they know we can do a lot better."
Pepper topped Mallory by 215 votes as just over 20 percent of the city's 212,688 registered voters went to the polls.
"We have a very strong message that is resonating with the people of Cincinnati: People want to see an end to the chaos, they want to see concensus at City Hall," Mallory said.
"People understand that we face a lot of problems in our city, but we can't solve them if we can't work together."
The issue of street crime dominated the campaign, from proposals to put more police on beats to dealing with the increasing number of guns in the hands of teens.
Television ads have concentrated on candidates' proposals to fight violence, create jobs and act on plans to develop shops and housing on the banks of the Ohio River.
The primary was the first step in an overhaul of city government, since it will be up to the new mayor to pick a city manager to succeed Valerie Lemmie, who left that job Sunday.
Lemmie left frustrated at what she believed to be council's determination to micromanage city government, and it's refusal to share power with the mayor and city manager.
She said the bickering left city employees wondering who was in charge, and further diluted the authority of the mayor and manager.
Cincinnati operated under a council-manager system from 1926 until a city charter amendment provided for direct election of mayor in 2001. There was no primary then because Luken, a former Democratic congressman and television anchor, ran unopposed and in the general election easily beat a candidate recruited by the Charter Party, the city's third political party.
The mayor, formerly a figurehead, was supposed to gain power under the new system. But Luken was dragged down by a boycott of downtown businesses and other continuing fallout from the April 2001 riots that grew out of the fatal shooting of an unarmed black man by a white police officer during an attempted arrest.
He announced a year ago that he would not run again.
Along with the November run-off for mayor, voters will have to choose among 31 candidates for nine council seats.