German speakers can also relate, with "apotheke". Interestingly, apotheke in modern Greek means "storage room", pharmacy is "pharmakeio". Ypotheke does mean mortgage in modern Greek too.
As dt_r pointed, apotheke always meant "away room" so it makes sense to think that it got the new meaning because of context: it surely was imported alongside other Greek terms about drugs.