Details of the victims of a mass shooting in Darwin have been revealed as Northern Territory police say they expect to soon lay charges against the alleged gunman.

One of the victims, a PhD student and taxi driver Hassan Baydoun, had never met the accused gunman, his cousin says.

Baydoun had been driving his taxi but returned home to his studio apartment in McMinn Street on Tuesday evening for a meal break.

He was there at the time the gunman was going from room to room inside the building, firing his gun and shouting the name of a man – Alex – according to witness Matthew James.

Baydoun, 33, moved to Darwin from Lebanon 10 years ago, his cousin and fellow Darwin resident Abdallah Salman said.

He had completed a bachelors as well as a masters degree in IT and was taking a break before starting his PhD.

“He was a lovely person, he had a good heart. He was a very easygoing person who was always smiling, a very happy person who didn’t have any enemies and his friends loved him,” Salman said.

“As we know now he was accidentally caught up in this, I have no idea but it looks like it was a random shooting.

“I don’t think he knows the guy or anything. The guy was looking for someone called Alex and he just got the wrong people.”

A group of about a dozen distraught men who were friends and relatives, including Salman, gathered after the shooting outside the Palms Hotel where Baydoun lived, with many in tears.

Baydoun’s two brothers used to live in Darwin but returned to Lebanon where his parents live.

His cousin, Haidar Baydoun, posted in Arabic on Facebook: “God has mercy on you, cousin.”

Ali Malik wrote “very sorry for your loss brother, he had nothing but smiles every time I spoke to him”.

The Islamic Society of Darwin held a prayer service on Wednesday for Baydoun.

The Blue Taxi Company said he was a beloved driver. “Our Company is heartbroken and his colleagues are in a state of shock,” a statement said. “Someone shot having a meal break while going about their own business.”

Police are still trying to determine if the victims were known to the alleged offender and have released further details and a timeline of events.

Officers alleged the man was searching for someone he knew at the Palms Motel. He allegedly threatened two people before shooting a 22-year-old female who sustained non-life threatening leg injuries. She is in hospital in a stable condition.

The gunman then fatally shot a 75-year-old man at a Gardens Hill Crescent residence. Nine minutes later, he allegedly killed a 57-year-old male at the Buff Club in Stuart Park. The last victim was a 52-year-old man who was shot dead at an address in Jolly Street, Woolner.

• Crisis support services can be reached 24 hours a day: Northern Territory Mental Health Line on 1800 682 288; Lifeline 13 11 14; Suicide Call Back Service 1300 659 467; Kids Helpline 1800 55 1800; MensLine Australia 1300 78 99 78; Beyond Blue 1300 22 4636