Hello brejo,
We understand that you're trying to use your iMac as a display for your Mac Mini along with another external display. We want to confirm, your setup first. Per Use multiple displays with your Mac, "For Mac computers with Mini DisplayPort, Thunderbolt, or Thunderbolt 2: You can connect up to two displays. If the displays themselves have Thunderbolt ports, you can connect one display to another, and then connect one of the displays to a Thunderbolt port on your Mac. If your Mac has two Thunderbolt ports, you can connect each display to separate Thunderbolt ports on your Mac. A DisplayPort device must be the last device in a chain of connected Thunderbolt devices."
Can you confirm that is how you're set up? Also, what operating systems are installed on your Mac Mini and iMac?
Thanks!