We present a study of the spin properties of dense layers of near-surface nitrogen-vacancy (NV) centers in diamond created by nitrogen ion implantation. The optically detected magnetic resonance contrast and linewidth, spin coherence time, and spin relaxation time, are measured as a function of implantation energy, dose, annealing temperature, and surface treatment. To track the presence of damage and surface-related spin defects, we perform in situ electron spin resonance spectroscopy through both double electron-electron resonance and cross-relaxation spectroscopy on the NV centers. We find that, for the energy (430 keV) and dose (5×10111013ions/cm2) ranges considered, the NV spin properties are mainly governed by the dose via residual implantation-induced paramagnetic defects, but that the resulting magnetic sensitivity is essentially independent of both dose and energy. We then show that the magnetic sensitivity is significantly improved by high-temperature annealing at 1100C. Moreover, the spin properties are not significantly affected by oxygen annealing, apart from the spin relaxation time, which is dramatically decreased. Finally, the average NV depth is determined by nuclear magnetic resonance measurements, giving 1017 nm at 4–6 keV implantation energy. This study sheds light on the optimal conditions to create dense layers of near-surface NV centers for high-sensitivity sensing and imaging applications.