While the majority of Afro-Middle Easterners (Afro-Iranians, Afro-Iraqis, etc) came to the Middle East via the Indian Ocean Slave Trade, many of them came for maritime work as well.

This manuscript from 1237 depicts Black sailors, presumably traveling through the Indian Ocean or Persian Gulf.

Source:
 

http://exhibitions.nypl.org/africansindianocean/essay-persian-gulf.php