How to connect a mini DisplayPort Windows PC with a Thunderbolt iMac
This is not possible using Apple's hardware and OS. As per Apple's kbase:
You need the following to use Target Display Mode:
A Mac notebook or desktop with a Mini DisplayPort or Thunderbolt port. If your Mac has Thunderbolt 3 (USB-C) ports, you can connect it using the Apple Thunderbolt 3 (USB-C) to Thunderbolt 2 Adapter.
A Thunderbolt cable or a Mini DisplayPort to Mini DisplayPort cable
A supported iMac with OS X v10.6.1 or later
See the list below for iMac models that support Target Display Mode, the type of cable you need to connect that model of iMac, and the kind of port you need on your other Mac.
A software solution, such as AirDisplay or Spacedesk, will be your best bet.
You might also be happier remoting in to the PC from the Mac as that typically is faster response times than pushing the PC screen to the Mac. Microsoft RD app is quite good running on Mac OS.