The five men, aged between 20 and 30 years, are accused of hijacking the South African yacht Choizil off the coast of Tanzania on November 7, the prosecutors said in a statement.
A European Union anti-piracy task force in the area, which included a Dutch marine ship, rescued one South African from the yacht but two other crew members were taken ashore as hostages.
Prosecutors said the five suspects were among 20 Somalis held by the Dutch ship. The others were released because there was insufficient evidence against them.
Heavily-armed gangs have seized dozens of vessels in the Indian Ocean and Gulf of Aden in recent years.
Somalia lacks the legal infrastructure to carry out trials and captured pirates are often released because of disagreements over which country should try them.
Most of the pirates who have been captured have been tried in Kenya or Seychelles. A Dutch court has sentenced five Somalis to five years in prison for piracy. A U.S. court sentenced a Somali for piracy last month, and ten suspected Somali pirates have gone on trial in Germany.
(Reporting by Gilbert Kreijger; Editing by Sara Webb)