MSF, which is also known as Doctors without Borders, said it would relocate some staff as a result of the shooting, which took place on Thursday in the capital Mogadishu.
More from GlobalPost: WFP - Three Somali aid workers shot dead
It is possible the men, Belgian Philippe Havet, 53, and Indonesian Andrias Karel Keiluhu, 44, were shot by a former MSF employee, the BBC reported.
On its website, MSF described Havet as an experienced emergency coordinator who had worked with the agency since 2000 in Angola, the Democratic Republic of Congo, Indonesia, Lebanon, Sierra Leone and South Africa.
Meanwhile Keiluhu was a doctor who had worked with MSF since 1998 in Indonesia, Ethiopia, Thailand and Somalia.
It is understood that one of the victims was killed instantly, while the other died later in hospital.
MSF said in a statement:
The exact circumstances of the shooting are not yet clear. MSF's immediate priority is to take care of those most affected by this tragedy, in particular the families and colleagues of the victims."
A Somali man who may have been sacked from his job at MSF has been arrested over the incident, the BBC reported.
Thursday's attack comes after three UN World Food Program (WFP) workers were shot and killed last week in the Somali town of Mataban, near the Ethiopian border.
GlobalPost analysis: Inside Somalia: Order restored in Mogadishu
The WFP, which suspended operations in the area, identified the victims as its employees Muhyedin Yarrow, 54, and Mohamed Salad, 28, and Doyale employee Abdulahi Ali.
The gunman gave himself up following the attack, which a town elder said concerned a personal matter.