I'm not sure if the original poster has already pulled the trigger on this purchase, but this is my take.
I have always been a big fan of the Mini, but I had to really think it out this time as far as value compared to an iMac 27" goes. It really depends what you want to use the Mac Mini for, and how you feel about the idea of an all in one. I personally have an aversion to the concept of an all in one, so that definitely pushed me back over to the Mini. Truthfully, there are not many manufacturers making 5K displays and the ones that are out there are very expensive. 5K is the perfect resolution for running the default effective resolution of 2560x1440p - which is why Apple chose it to begin with. The value of the iMac display is very high - but it can never be used as an external display for anything in the future which negates some of that value.
I had an egpu setup that I was using with a Windows laptop that I knew I could repurpose for the Mini. The integrated graphics on the Mini are really not great, so I think you kind of have to add that to the cost of the Mini when comparing it to the iMac. I ended up paying around $300 for a Gigabyte Gaming Box with a RX580 during a black Friday deal last year. So an egpu does not have to cost a lot, but the extra cost should be kept in mind when comparing with an iMac.
As for storage, personally I cannot see the point in paying Apple prices on storage for desktop systems that are not going to be moved around a lot. I purchased a TB3 TekQ Rapide with 256GB nvme for $145 and used it as an enclosure for a $100 Inland Premium 1TB nvme (same exact storage as the Sabrent Rocket and Corsair MP510). On the Mac Mini I am getting just about 2 GB/s read and write. Total cost for 1TB was around $245.
As I post a link to the TekQ Rapide - it appears they have lowered the price on the 1TB drive to $299, and upped the lower model from 256GB for $145 to 480GB for $199. So instead of using it as an enclosure you can always just use it outright the way it comes.
TekQ Rapide:
https://www.amazon.com/gp/product/B07GZG3C15
Here is a review on the TekQ Rapide. It is as nice as AnandTech describes it (looks and feels like something Apple themselves would make):
https://www.anandtech.com/show/12443/tekq-rapide-thunderbolt-3-external-ssd-review
Tweaktown review:
https://www.tweaktown.com/reviews/8...-thunderbolt-3-portable-ssd-review/index.html
Here is the 1TB Inland Premium nvme I threw in the TekQ Rapide. In the Mac Mini attached to TB3 I am getting just around 2,000 MB/s read and write. In a 2015 MBP 15 I am getting 2,700 MB/s read and write with the same storage.
https://www.microcenter.com/product...80-pcie-nvme-30-x4-internal-solid-state-drive
These have been selling out every time they come back in stock (but are replenished quickly) since they lowered the price to $105 and now $99. It uses a Phison controller and is an identical drive to many others on the market.
Memory is easily upgraded in the Mini - it went a lot quicker than what I had thought it would, so that is another way to easily save money on upgrades. Memory is pretty cheap right now which is a big plus.
I think the i5 is a good choice in the Mini. Mine gets right around 22K on Geekbench 4 and benches pretty close to some of the weaker i7 scores that I have looked at. The 256GB SSD that came in mine was slower on writes but quicker on reads than the TB3 TekQ Rapide with Inland Premium that I used.
Mac Mini 2018 i5 256GB Internal SSD (FileVault On):
Mac Mini 2018 i5 External TB3 TekQ Rapide with Inland Premium 1TB (FileVault On):
Mac Mini 2018 i5 OpenCL:
Mac Mini 2018 TB3 connected Gigabye Gaming Box RX580:
Mac Mini 2018 i5 256GB Geekbench 4:
I hope this helps you one way or the other. I don't think you can go wrong with either the Mac Mini or iMac.