The scenario of a metal-insulator transition driven by the onset of antiferromagnetic order in NaOsO$_3$ calls for a trustworthy derivation of the underlying effective spin Hamiltonian. To determine the latter we rely on {it ab initio} electronic-structure calculations, linear spin-wave theory, and comparison to experimental data of the corresponding magnon spectrum. We arrive this way to Heisenberg couplings that are $lesssim$45% to$lesssim$63% smaller than values presently proposed in the literature and Dzyaloshinskii-Moriya interactions in the region of 15% of the Heisenberg exchange $J$. These couplings together with the symmetric anisotropic exchange interaction and single-ion magnetocrystalline anisotropy successfully reproduce the magnon dispersion obtained by resonant inelastic X-ray scattering measurements. In particular, the spin-wave gap fully agrees with the measured one. We find that the spin-wave gap is defined from a subtle interplay between the single-ion anisotropy, the Dzyaloshinskii-Moriya exchange and the symmetric anisotropic exchange interactions. The results reported here underpin the local-moment description of NaOsO$_3$, when it comes to analyzing the magnetic excitation spectra. Interestingly, this comes about from a microscopic theory that describes the electron system as Bloch states, adjusted to a mean-field solution to Hubbard-like interactions.