Not really. Not directly anyway. I think the last year for Thunderbolt Target Display for iMacs was 2013, though please someone correct me if I'm wrong. I don't think the 5K iMac ever had Target Display Mode.
You can investigate this, but I'm not sure how the performance would be...
It'll cost you a couple of hundred dollars and a few hours of your time, but you can repurpose the screen into a monitor for your new setup – just make sure you get the right driver board for the panel.