HornAfrik's broadcasts have criticised both the government and the Msulim groups who have been trying to topple the administration.
Elmi was fatally shot by two armed men outside his office early on Saturday, while Sharmarke was killed hours later as he returned from his colleague's funeral.
A remote-controlled landmine struck his vehicle.
Elmi was shot four times in the head at close range as he neared the door of his office at 7.15am (0415 GMT).
"We were outside when four gunmen jumped out," a colleague said at the hospital where the talk-show host's body lay.
"They fired four shots against Mahad's head ... then they just fled".
Sharmarke died when his vehicle hit an explosive device in the road on his way back from the funeral.
Sahal Abdulle, a Reuters journalist who was sitting next to Sharmarke at the time of the blast, was lightly injured in the head and face.
Pressure on journalists
Al Jazeera's Mohammed Adow, who knew both of the journalists, said: "Moments before Ali Imam was killed, he had told journalists about the movements silencing the Somali media who were talking about the poor conditions of Somali people today.
"Pressure has been mounting on Somali journalists. They have been victimised for not reporting on issues of interest to certain groups.
|"The transitional government must take urgent steps to protect journalists and thoroughly investigate and punish these murders to prevent further killings" |
Reporters sans Frontieres
"This just shows how dangerous Somali has become for journalists."
The journalists' union in Somalia has expressed "outrage" at both killings, which they said were deliberate.
"The National Union of Somali Journalists is outraged by today's assassination of ... Ali Iman Sharmarke after a vehicle he was riding in was blown up by a remote-controlled mine by unknown assailants," it said in a statement.
Six media workers have been killed in Somalia so far this year, Paris-based Reporters sans Frontieres said on Saturday.
It said: "The transitional government must take urgent steps to protect journalists and thoroughly investigate and punish these murders to prevent further killings."
Early on Saturday, Jafar Kukay, assistant director of Shabelle, one of Mogadishu's main radio stations, said a journalist working for the radio who had been arrested on Friday, was still in custody.
The journalist was detained during a raid by security forces, who ordered it off the air and detained seven members of staff.
Kukay had said that they had accused the radio station of putting out an inaccurate report on violence in Mogadishu the day before.
All the other employees have since been released and the radio has resumed its programming.
It is the third time since January that a radio station in Mogadishu has been raided by the authorities.
Somalia has experienced continued instability despite dozens of peace initiatives since the overthrow of Siad Barre, former president, in 1991.