It has been recently shown that the discrepancy between the theoretical and experimental values of the anomalous magnetic moment of the muon can be fully accommodated by considering the contribution of few Kaluza-Klein (KK) states of the gauged lepton number with masses lighter than the LEP energy, consistently with present experimental limits. In this article, we construct the minimal embedding of the Standard Model (SM) into D-brane configurations with a gauged lepton number. In order to give rise to such KK modes, the lepton number gauge boson must live on an abelian U (1) L brane extended along at least one "large" extra dimension in the bulk, with a compactification scale M L ∼ O(10 − 10 2 GeV) for a string scale M s > ∼ 10 TeV. As a consequence, U (1) L cannot participate to the hypercharge linear combination. We show that the minimal realisation of this framework contains five stacks of branes: the SM color U (3) c , weak U (2) w and abelian U (1) stacks extended effectively only in four dimensions, the bulk U (1) L , as well as a fifth U (1) brane. With these five abelian factors, one finds besides the hypercharge a second anomaly-free linear combination which does not couple to the SM spectrum, both in the non-supersymmetric case as well as in the minimal supersymmetric extension of the model. It is also shown how the right-handed neutrino can be implemented in the spectrum, and how fermions arising from the two non-SM branes and coupled to the SM through the U (1) L KK modes can provide Dark Matter candidates. Finally, the possibility of breaking Lepton Flavour Universality is studied by replacing U (1) L with a brane gauging only the muonic lepton number, avoiding most experimental constraints and enlarging the parameter space for explaining the discrepancy on the muon magnetic moment.