Target Display Mode between a Dell XPS and 2013 iMac I have been searching for a long time for the answer to this question.

I have a Dell XPS laptop with minidisplay port out and a 2013 iMac.

Can I buy a mini-display port cable and connect it to the thunderbolt port on the mac and use Target Display Mode.

or

Can I buy a thunderbolt cable and connect that to minidisplay port on the Dell and use target display mode
I'm pretty sure it can't be done - but I can't find anywhere that categorically says so.

Two reasons in your particular case.

The iMac 2013 needs Thunderbolt to Thunderbolt, not mini Display Port.

Both machines need to be running macOS to enable the function.
Macs running Windows in Boot Camp cannot use Target Display Mode.

Background info from Apple KB - Use your iMac as a display with Target Display Mode

Also - 
Using MacBook Pro as keyboard/mouse for Windows computer for alternative methods of displaying one machine on another.