Connecting Raspberry Pi 4 to iMac 2011 (27″)

What about the micro Displayport?

iMac 2011 has a Thunderbolt port, not a DisplayPort. It only works as a display with other Thunderbolt Macs, and you’ll need to use some previous operating systems as well.

(I’ve owned a 2011 iMac for several years, always hoping a rumored adapter would be released, but it never happened.)

The Apple support article above should show what target display mode will work with, unfortunately it has to be another lightning bolt mac.