Can you use iMac Retina 5K as external monitor for a MacBook Pro?

Solution 1:

According to Apple, no. The iMac Retina 5K does not support Target Display Mode.

Note that the iMac (Retina 5K, 27-inch, Late 2014) does not support Target Display Mode.

You can see it here.

Solution 2:

I have the iMac Retina 5k and can confirm that it doesn't support Target Display Mode. However, there's no problem with using thunderbolt bridge and screen sharing, i.e. "same same but different" ;)