One option for using an iMac as a display for another Mac is called Target Display Mode:
https://support.apple.com/en-us/HT204592
this does not help you if you are using a PC
If you have one of the older 2010 vintage 27" iMacs with a Mini Display Port, NOT the current Thunderbolt type port, you might be able to use the Kanex XD adapter with the PC as the video source with the appropriate 1280x720 settings. (I have one of those iMacs and that adapter and could not get it to work, not sure what the magic trick is, I bought it used from eBay, no returns)
http://www.kanex.com/xd
Those hardware options would be the best performance wise, but if your equipment is not compatible with any of those options, then you have a software option using the Remote Desktop Connection app on the Mac and setting up the PC as a Server. You might have to use another monitor temporarily to set up the PC as a server, but then should be able to run the PC "headless" (without a monitor) and access it over the network (Ethernet or WiFi) from the Mac with some lag due to the video connection over the network, not really good for high frame rate games, but ok for basic email/web stuff.
https://technet.microsoft.com/en-us/library/dn473012(v=ws.11).aspx
not sure if you can find older versions if you need them for whatever Mac OS version you might be running. (I did not notice your signature at first that shows which iMac and OS you are running, the light grey text is hard for me to see even with my glasses on)