I did some googling around. It looks like iMac displays are panels from LG, Samsung, possibly others, that use a standard interface (eDP, I believe). So (standard disclaimers apply), if you disassemble your iMac and find the model number of the panel, you can probably find a controller on Amazon, eBay, or elsewhere. You would also need a power supply.
Googling iMac lcd controller will turn up lots of hits, like this one:
Your prompt reminded me. The controller for the 5k monitor is actually treating the screen as two separate screens which are synchronised to allow the image to be displayed. I doubt there’s a simple way to directly control them as a single display.