Sinn Féin's Máirtín Ó Muilleoir said at one stage he feared neither him nor police officers shielding him from loyalist protestors would make it out.
As three men and a woman faced charges over the scuffles last summer, Mr Ó Muilleoir recalled being kicked, jostled and subjected to a stream of sectarian abuse.
Police had to surround him in a diamond-shaped formation to escape from Woodvale Park.
The Lord Mayor said: "I had no doubt at the time and I have no doubt today that if I had gone down, there's no knowing what would have happened.
"Your life was in peril if you fell."
Belfast Magistrates' Court was packed for Mr Ó Muilleoir's evidence about being targeted as soon as he arrived to re-open the park on 6 August.
He had come from similar duties at Dunville Park, with unionist and nationalist political representatives due to be present at both events.
But he said a banner and laminated posters had been erected to declare him not welcome at Woodvale.
Some of the crowd allegedly shouted "terrorists" and "Fenian b******".
Mr Ó Muilleoir said the pushing and shoving began immediately after he got of his car for the opening and tree-planting ceremony.
Tensions had been running high in the city at the time, with demonstrations continuing over the union flag situation and the ban on Orangemen parading past Ardoyne.
Laughter broke out in the public gallery as the Lord Mayor recalled being hit on the back of the head by a burger.
DUP councillor Ruth Patterson was in the front row, sitting alongside a woman waving a Union flag fan.
Details of the incident emerged as Maureen Simpson, 44, of Palmer Court, Samuel Lendrum, 52, from Lawnbrook Avenue, and Paul Mateer, 45, of Blackmountain Walk - all in Belfast - appeared in the dock charged with disorderly behaviour.
Mateer, working as a photographer for the local Shankill Extra newspaper at the event, faces further counts of obstructing and assaulting police.
A fourth defendant, William Knowles, 41, of Cambrai Street in the city, pleaded guilty to disorderly behaviour before the contested hearing got underway.
According to Mr Ó Muilleoir, unionist representatives were to have been with him at the event to symbolise peace-building in the area.
But instead he was left "isolated" when none were with him as the situation worsened, the court heard.
He was taken to a building in a fenced-off section of the park where police devised their strategy for getting him out.
I have respect for the police officers who put themselves in great danger.
Lord Mayor Máirtín Ó Muilleoir
"I think they didn't expect the ferocity of the attack on them and me as we left the park," the Lord Mayor said.
"It was a very hateful atmosphere, very tense and very dangerous."
District Judge George Conner was told how a crowd of up to 70 people surged forward during the exit.
"I thought for a moment we wouldn't get out, that we were going to go down," Mr Ó Muilleoir said.
Amid the "cacophony" of sectarian insult an unidentified protestor kicked him in the leg, it was claimed.
"It was vile abuse, it was violent abuse and it was vitriolic," he said."No one should be subjected to that hate and sectarianism."
Asked about being called 'Martin Miller' by crowd members, the Lord Mayor claimed it was an attempt to deny him his proper name.
"It comes from deep-seated sectarianism, it comes from hate and it comes from a lack of respect," he said."I only hear that type of approach used by people who are bigoted. I think it's silly."
Cross-examined by Kelly Doherty, for Lendrum, about a letter from DUP politicians advising him not to attend the event.
He said some people in the party would have preferred it if he had not gone.
Counsel for Mateer, Jonathan Connolly, questioned him about photographs taken on the day.
"Are you relaxed in the photograph where you're eating a sandwich?" the barrister asked.
"Are you relaxed in the picture where you have a shovel in your hand?"
Mr Ó Muilleoir insisted, however, that both himself and police had been at risk.
He added: "I have no doubt if the protestors had got at me either going in or going out that my life was in danger."
The case continues.