The pirates fired several shots at the German-owned ship BBC Togo, which sails under the flag of Antigua and Barbuda, but the crew fought off the attackers who were unable to board it, a ministry spokesman said.
It was the latest of many attacks by heavily armed pirates from the lawless Horn of Africa nation on vessels in shipping lanes in the Indian Ocean and the strategic Gulf of Aden, which links Europe to Asia through the Red Sea.
The attack, using small motor-boats, took place on Wednesday afternoon, and the Dutch marine ship Evertsen boarded the pirate craft that night and captured the pirates, who all appeared to be Somalis, the spokesman said.
"The pirates apparently thought they were safe. The marine ship was able to approach them without being noticed -- lights out -- and boarded the ship," the spokesman said.
The naval vessel captured the pirates, who surrendered without a struggle, in the Gulf of Aden, about 150 miles south of Oman's port city of Salalah.
The Dutch also freed two Tanzanian fishermen held captive for three months after the pirates seized their fishing boat, a dhow, the spokesman said.
On board the pirates' vessel, the Dutch navy found a dozen guns including AK-47s, several grenades, two rocket launchers and several ammunition chests.
The pirates will be handed over to authorities in Kenya or the Seychelles, which have agreements with the European Union to try suspected pirates, the spokesman said.
Somali Prime Minister Omar Abdirashid Ali Sharmarke plans to visit the Netherlands next week to attend a conference in The Hague on Somali piracy and its impact on the the world economy.