Magnetometry by cross-relaxation-resonance detection in ensembles of nitrogen-vacancy centers