Interacting resonators can lead to strong nonlinearities but the details can be complicated to predict. In this work, we study the nonlinearities introduced by two nested microcavities that interact with nitrogen vacancy centers in a diamond waveguide. Each cavity has a differently designed resonance: one in the green and one in the infrared. The magnetic-field dependence of the nitrogen vacancy center absorption rates on the recently observed infrared transitions allows us to propose a scalable on-chip magnetometer that combines high magnetic-field sensitivity and micrometer spatial resolution. By investigating the system behaviors over several intrinsic and extrinsic parameters, we explain the main nonlinearities induced by the NV centers and enhanced by the cavities. We finally show that the cavities can improve the magnetic-field sensitivity by up to two orders of magnitude.