The OED says that the relevant senses of mate come from "Middle Low German māt comrade", and suggests that we "Compare early modern Dutch maat (1546), maet (1573) friend, partner". The OED traces the English sense "A companion, fellow, comrade, friend; a fellow worker or business partner" back to 1380, and notes that this is "Freq. as the second element in compounds, as bed-, flat-mate, etc. (in which it is generally less colloq. than when standing alone)". @FiorenzaMella