You should now see the desktop of the other Mac.
You can use more than one iMac as a display, if each iMac is using a Thunderbolt cable to connect directly to a Thunderbolt port on the other Mac (not the other iMac).
Make sure that your iMac is started up and meets the system requirements above.