This article explains how to use an old iMac from late 2009 through 2013 as a display for another Apple device. If you have an old iMac with Target Display Mode, your Mac mini or another Mac can use your old 27-inch iMac as a display.
How to cheaply convert an old iMac into a second monitor!
Display mode-compatible 27-inch iMacs have either a bi-directional Mini DisplayPort or a Thunderbolt port (depending on the model). You'll need the appropriate ports and cables to connect your two Macs.
The iMac used as a display must be running macOS High Sierra (10.13. 6) or earlier. The source Mac must have macOS Catalina (10.15) or earlier installed.
The 27-inch iMacs, introduced in late 2009, included the first version of Target Display Mode, a feature that allowed iMacs to be used as displays for other Apple devices. However, when Apple released the 2014-2015 Retina Display iMacs, it dropped support for the feature.