Aims. With an observing time span of more than 20 yr, the CORALIE radial-velocity survey is able to detect long-term trends in data corresponding to companions with masses and separations accessible to direct imaging. Combining exoplanet detection techniques, such as radial velocities from the CORALIE survey, astrometric accelerations from HIPPARCOS and Gaia eDR3, and relative astrometry from direct imaging, removes the degeneracy of unknown orbital parameters. This allows precise model-independent masses of detected companions to be derived, which provides a powerful tool to test models of stellar and substellar mass-luminosity relations. Methods. Long-term precise Doppler measurements with the CORALIE spectrograph reveal radial-velocity signatures of companions on long-period orbits. The long baseline of radial-velocity data allows the detectability of the companion candidates to be assessed with direct imaging. We combine long-period radial-velocity data with absolute astrometry from HIPPARCOS and Gaia eDR3 and relative astrometry derived from new direct imaging detections with VLT/SPHERE to fit orbital parameters and derive precise dynamical masses of these companions. Results. In this paper we report the discovery of new companions orbiting HD 142234, HD 143616, and HIP 22059, as well as the first direct detection of HD 92987 B, and update the dynamical masses of two previously directly imaged companions: HD 157338 B and HD 195010 B. The companions span a period range of 32–279 yr and are all very low-mass stellar companions, ranging from 218 to 487 MJup. We compare the derived dynamical masses to mass-luminosity relations of very low-mass stars (<0.5 M⊙), and discuss the importance of using precursor radial-velocity and astrometric information to inform the future of high-contrast imaging of exoplanets and brown dwarfs.