Honestly the iMac 5K is a MUCH better value proposition. The Mac mini wins in pure CPU power if you go with the i5 or i7, but everything else is better on the 5K iMac (actually user-upgradeable RAM, a proper GPU, comes with a 5K display and all the peripherals you need). If you want a comparable Mac mini to the base model 5K iMac you'd have to spend around $2200 just for the computer, monitor (if you wanted to get a comparable LG UltraFine 5K display), keyboard and mouse. You wouldn't even have a GPU yet, which would cost at least another $700.
With that said, I REALLY wish the iMac came in a 6-core version.