A new set of 5-chlorobenzoxazole- and 5-chlorobenzothiazole-based derivatives containing the azepane ring as a basic moiety was designed, synthesized and evaluated through binding assays to measure their affinity and selectivity towards σ1 and σ2 receptors. Compounds 19, 22 and 24, with a four units spacer between the bicyclic scaffold and the azepane ring, showed nanomolar affinity towards both receptor subtype and the best Ki values (Ki σ1 = 1.27, 2.30, and 0.78 and Ki σ2 = 7.9, 3.8, and 7.61 nM, respectively). Evaluation of cytotoxic and apoptotic effects in MCF-7 human cancer cells was useful to assess σ2 receptor activity, while an in vivo mice model of inflammatory pain allowed to analyze σ1 receptor pharmacological properties. In vitro and in vivo results suggested that compound 19 is a σ1/σ2 agonist, compound 24 a σ1 antagonist/σ2 agonist, whereas compound 22 might act as σ1 antagonist/σ2 partial agonist. Due to their pharmacological profile, a potential therapeutic application in cancer of aforesaid novel σ1/σ2 receptor ligands, especially 22 and 24, is proposed.