Hello, celine994.
Here are the rules for Target Display mode on iMac:
click> Use your iMac as a display with target display mode - Apple Support
Target display mode is a feature that was available only with certain older iMac models.
Only the following older iMac models can be used as an external display when plugged into another older Mac model:
- iMac models introduced in 2011, 2012, 2013, and mid 2014 using Thunderbolt or Thunderbolt 2 cable.
- 24-inch and 27-inch iMac models introduced in 2009 and 2010 using Mini DisplayPort cable.
- The intended target iMac must be running macOS 10.13 High Sierra or earlier; it does not work with macOS 10.14 Mojave or later, or with Boot Camp and Windows.*
- Retina display iMacs won’t work as target displays.
- In all cases the source Mac that you're connecting FROM must have been introduced in 2019 or earlier and have macOS 10.15 Catalina or earlier installed.
Not sure if that can be done from a Windows PC at all.
You should remember that the iMac is a computer. It really was not designed to be just a monitor.
Good luck and happy hunting, though.