Anies Baswedan, who was accused of pandering to hardliners to win votes, and his supporters cheered as news came through that surveys showed him winning by over 10 percentage points against Basuki Tjahaja Purnama, who was fighting for his job while standing trial for blasphemy.
Official results are not expected until early May but the private pollsters, who count a sample of votes, are usually accurate.
It came against a backdrop of rising religious intolerance that has tainted the image of the diverse Indonesian archipelago as a pluralistic country in recent years, with a surge in attacks on minorities.
Baswedan, a former education minister, thanked Jakarta's voters for supporting him and hinted that he would move to heal the divisions in the capital after the bitter poll, if his victory was confirmed.
More From This Section
Purnama, the city's first non-Muslim governor for half a century and its first ethnic Chinese leader, congratulated Baswedan and his running mate, adding: "We are all the same, we want a good Jakarta, because it is our home."
The defeat is also a blow for President Joko Widodo, whose party had backed Purnama.
The incumbent had long been a shoo-in to win re-election after gaining popularity due to his determined efforts to clean up Jakarta.
But the governor -- known by his nickname Ahok -- lost a once-unassailable lead after a controversy erupted last year over claims that he had insulted Islam, a grave charge in Indonesia.
The allegations drew hundreds of thousands of conservative Muslims onto the streets of Jakarta in major protests, and led to Purnama being put on trial for blasphemy in a case critics see as politically motivated.