"it’s that I’m dismantling my iMac and wanted to make use of everything available still working."
Ah, ok, you didn't say that.
I'm actually in a similar position now, a friend recycled a MacBook Pro and saved the DVD/CD drive (which he offered to me).
An enclosure will run $20-30.
But, there really aren't too many that are designed to accept slot-loading drives.
You need to measure the height of the drive (from the iMac).
Is it 9.5mm?
Or, is it 12.7mm?
You need to order the correct enclosure to fit.
I may try it, just for the satisfaction of seeing if it works.
But then again, I could spend $10-15 more for a genuine Apple SuperDrive (open box).