Can a USB-C to mini DisplayPort cable be used with USB-C to Thunderbolt ports?
Here are some basic rules about Thunderbolt and DisplayPort cables:

Any Type C Thunderbolt 3 cable is also a USB-C cable.  Only quality USB-C cables are also Thunderbolt 3 cables.  In other words, avoid cheap ones.

Thunderbolt 1 and Thunderbolt 2 cables, while they carry the mDP signal are not mini DisplayPort cables.  mDP cables are not Thunderbolt cables and vice versa.

Thunderbolt cables can only be used on Thunderbolt ports.

mDP cables can be used in either mDP ports or Thunderbolt ports


Source:  TrippLite.com



So do I need a different cable if the only thing that is changing in the configuration is that instead of a mini DisplayPort on the iMac, I have Thunderbolt port on the iMac.

Yes.  The 2011 iMac (27&quot; only) support Target Display Mode via Thunderbolt only.  You will need the following:

Thunderbolt 1/2 cable
Thunderbolt 3 to Legacy Thunderbolt Adapter

The 2011 iMac is a very different animal compared to the 2010 that uses DisplayPort.  To connect to it via Target Disk Mode, it requires a TB connection. So you'll need a proper adapter and cable to make this work.