Imaging faint objects, such as exoplanets or disks, around nearby stars is extremely challenging because host star images are dominated by the telescope diffraction pattern. Using a coronagraph is an efficient solution for removing diffraction but requires an incoming wavefront with good quality to maximize starlight rejection. On the ground, the most advanced exoplanet imagers use extreme adaptive optics (ExAO) systems that are based on a deformable mirror (DM) with a large number of actuators to efficiently compensate for high-order aberrations and provide diffraction-limited images. While several exoplanet imagers with DMs using around 1500 actuators are now routinely operating on large telescopes to observe gas giant planets, future systems may require a tenfold increase in the number of degrees of freedom to look for rocky planets. In this paper, we explore wavefront correction with a secondary adaptive optics system that controls a very large number of degrees of freedom that are not corrected by the primary ExAO system. Using Marseille Imaging Testbed for High Contrast (MITHiC), we implement a second stage of adaptive optics with ZELDA, a Zernike wavefront sensor, and a spatial light modulator (SLM) to compensate for the phase aberrations of the bench downstream residual aberrations from adaptive optics. We demonstrate that their correction up to 137 cycles per pupil with nanometric accuracy is possible, provided there is a simple distortion calibration of the pupil and a moderate wavefront low-pass filtering. We also use ZELDA for a fast compensation of ExAO residuals, showing its promising implementation as a second-stage correction for the observation of rocky planets around nearby stars. Finally, we present images with a classical Lyot coronagraph on MITHiC and validate our ability to reach its theoretical performance with our calibration.