He represents the local Kraków dla Mieszkańców (Kraków for Residents) council group, which he founded.
Monika Piątkowska, a senator for the ruling Civic Coalition (KO) also backed by the Polish People's Party (PSL), came second with 29.91 percent.
They will face each other in a run-off vote on 11 October, as neither candidate secured the majority needed for outright victory.
Other candidates trailed further behind: Michał Drewnicki of the opposition Law and Justice (PiS) party took 17.5 percent, Aleksandra Owca of the left-wing Razem party 6.91 percent, Daria Gosek-Popiołek of the Left (Lewica) 4.81 percent, Michał Klimek of the far-right Confederation of the Polish Crown 4.11 percent, and Sławomir Pietrzyk of the Polish Social Democracy party 0.37 percent.
Turnout stood at 43.5 percent.
The election was called after Kraków residents voted in a May referendum to recall Aleksander Miszalski, also of KO, from the mayor's post.
Miszalski's removal, just two years into his term, dealt a political blow to Prime Minister Donald Tusk's governing coalition.
Polls showed that voters' main grievances included the city's rising debt, allegations of cronyism and a controversial clean transport zone that increased parking fees and public transport fares.
Gibała, who narrowly lost the 2024 mayoral run-off to Miszalski, has campaigned on tackling political appointments at city hall, trimming the size of municipal company boards and scrapping the mass sell-off of city-owned flats.
(ał)
Source: PAP, onet.pl