Your iMac is also probably too old to be used as an AirPlay Receiver for AirPlay to Mac – a lower-quality way of using one Mac to display video output from another.
Only the 2019 iMacs are both old enough to run Catalina and new enough to be AirPlay Receivers for AirPlay to Mac (after a macOS upgrade). You can upgrade those Macs to anything from Big Sur to Sequoia, and I am guessing that if you had one of them, you probably would be running something newer than Catalina by now.
Continuity features and requirements for Apple devices - Apple Support
There are third-party applications that can turn older Macs into "AirPlay Receivers", but again, the quality won't be the same as with a wired connection to a real hardware monitor or to an iMac acting as a Target Display.
You may want to look into getting a real monitor.