On my Nvidia Titan X, I started the computer with only the mini DisplayPort cable connected and booted at 4K. Then when OS X has finished starting up, I also plug in the dual DisplayPort cables. The monitor remains at 4K until I switch the input to dual DisplayPort (leaving the mini DisplayPort cable plugged in). The monitor goes black, then comes back in 5K mode. I didn't even have to power it off or unplug it. I can then use the 2560 x 1440 HiDPI mode which uses the 5120 x 2880 resolution. If I switch back to mini DisplayPort, then the monitor goes to 4K resolution, but I don't see anything because the OS thinks there are two monitors plugged in, and all my windows are on the hidden 5K frame buffer. At this point, I can use another Mac to Share Screen, and see both the 5K and 4K frame buffers. When I switch the monitor input back to 5K mode, the 4K frame buffer is removed from the Share Screen UI, and I see the 5K frame buffer in both the Share Screen app, and on the Dell monitor.
I can do 2560 x 1440 HiDPI while on 4K but it uses a 5K frame buffer scaled to 4K so it's not as clear as 2560 x 1440 HiDPI while on 5K.
Remember that the Dell monitor is much slower than every other monitor at switching resolutions or waking from sleep or whatever (Dell has documented this on their website) because of the 5K feature. I have Monitor Sleep set to disable in the Energy settings of the Dell monitor menu which helps with some issues.
I am still using Mac OS X 10.11.5.
I switched back and forth between inputs a few more times, and eventually got a kernel panic in NVDAResmanWeb.