One crew member aboard the "Remas" had a bullet wound and the other suffered a concussion, officials told Reuters. Both men were taken to a hospital. Their conditions were not immediately available.
The "Remas" is a supply vessel for Mexico's oil industry and is owned by Micoperi, an Italian contractor.
The attack was carried out by around eight armed men who boarded the ship from two fishing boats off the coast of Ciudad del Carmen in the southeastern Mexican state of Campeche.
The "Remas" had a crew of about 35 when the attack occurred.
The southern Gulf of Mexico has seen an increase in pirate attacks on boats and oil platforms in recent years.