  We propose a model which generates neutrino masses by the inverse seesaw
mechanism, provides a viable dark matter candidate and explains the muon
($g-2$) anomaly. The Standard Model (SM) gauge group is extended with a gauged
U(1)$_{\rm B-L}$ as well as a gauged U(1)$_{\rm L_{\mu} - L_{\tau}}$. While
U(1)$_{\rm L_{\mu} - L_{\tau}}$ is anomaly free, the anomaly introduced by
U(1)$_{\rm B-L}$ is cancelled between the six SM singlet fermions introduced
for the inverse seesaw mechanism and four additional chiral fermions introduced
in this model. After spontaneous symmetry breaking the four chiral fermionic
degrees of freedom combine to give two Dirac states. The lightest Dirac fermion
becomes stable and hence the dark matter candidate. We focus on the region of
the parameter space where the dark matter annihilates to the right-handed
neutrinos, relating the dark matter sector with the neutrino sector. The
U(1)$_{\rm L_{\mu} - L_{\tau}}$ gauge symmetry provides a flavour structure to
the inverse seesaw framework, successfully explaining the observed neutrino
masses and mixings. We study the model parameters in the light of neutrino
oscillation data and find correlation between them. Values of some of the model
parameters are shown to be mutually exclusive between normal and inverted
ordering of the neutrino mass eigenstates. Moreover, the muon ($g-2$) anomaly
can be explained by the additional contribution arising from U(1)$_{\rm L_{\mu}
- L_{\tau}}$ gauge boson.
