Connect MacBook Pro 2015 to iMac 2015 with HDMI? I forgot to bring my "Thunderbolt to Thunderbolt" cable to connect my MacBook Pro to my iMac screen. I do not wish to spend again all that money to go buy one now.

The only thing I have here is a "HDMI to HDMI" cable and there is a possibility for me to go buy an "HDMI to Mini DisplayPort" which are cheap.

I would like to know if connecting the HDMI from my MacBook and using the adapter to connect to the Thunderbolt of my iMac will work.
Target Display Mode needs DisplayPort or Thunderbolt. It cannot use passive HDMI adapters or ones that don’t support active HDMI to DisplayPort. 


https://www.amazon.com/DisplayPort-Adapter-FOINNEX-Converter-Compatible/dp/B07G796JF8/
https://www.amazon.com/StarTech-com-HDMI2DP-DisplayPort-Active-Converter/dp/B004I6IYSM/


Warning, that the apple link only lists DisplayPort in for some models of Mac. Be sure you can return anything you buy if you’re not sure it will work or have the seller or manufacturer confirm your specific Mac and use. 

Source : Apple KB - Use your iMac as a display with Target Display Mode