Bossman, who stood for the Social Democrats (SD), the ruling party at the national level, won what has been dubbed the "battle of doctors" against Gantar of the local Piran Is Ours party.
"I am happy and proud. The people have won. I based my campaign on dialogue and I think dialogue has won," Bossman, popularly referred to as the "Obama of Piran", told the press.
Bossman, who has private practice and runs an association helping drug addicts on the coast, said he would return to his practice tomorrow and take his time to get ready for the new job.
The race in Piran was seen as a test of Slovenia's maturity of sorts.
As columnist Vlado Miheljak put in recently in daily Dnevnik, it will show whether the "proverbially "black" [conservative] Slovenia is mature enough to elect a non-white political representative at a high enough level."
There have been no reports of racism in the campaign, although some, including the populist Koper Mayor Boris Popovic, complained that Bossman's Slovenian was not exactly perfect.
Born in Ghana on 2 November 1955, Bossman moved to Slovenia in the 1970s when he won a scholarship to study in the former Yugoslavia.
He was elected to the Piran City Council in 1998 and also held a term as the president of the local community of Lucija, a part of the Piran municipality.
Turnout in Piran was just shy of 45%, five points lower than in the first round.