As a long-time MX-5'er (had 5 of the little buggers, NA and NB) and a year or so into a '05 3.0 Z4, I have a lot of comparison data and impressions.
They are really two very different cars. The Z is aimed at a more upscale audience who might otherwise buy a Porsche and who value comfort, convenience, and to some extent, snob appeal, and aren't going to go autocrossing. Here in the states anything BMW is assumed to be luxury and expensive. The joke is that BMW's automatically reduce the driver's IQ. The Miata is aimed quite a bit lower, at a more focused audience who yearn for the British sports cars that exist only in memories. As an older person who values some comfort and lucked in to a pristine Z at an unbelievable price, I quite like it; but I wouldn't have paid the full KBB value.
The Z is bigger, roomier, more comfortable, but just. More elbow room, but I don't find the seats to be a major improvement. Aftermarket seats exist for the MX5, but that's more money. The Z is just plain nicer. The quality of the interior, the paint, the fit and finish, are all noticeably better. The Z is just nicely bolted together. Of course, on used ones, this will be an individual matter.
Parts costs, except for the majorly expensive stuff like pistons, tops, and unique trim pieces, are not that far apart. The MX5 has the advantage of sharing parts with every Mazda ever made, while the E-85 shares with the E-46, I believe, so both have a wealth of spares. One big difference is BMW's insistence on design uniqueness, like fasteners not found anywhere else in the world (I refer to those little square headed buggers, 8 of them, that partly hold on the slam panel under the hood. Phillips work just fine there) but that's kind of the way of the world. Avoid the dealers at all costs. On balance, though, my nod goes to Mazda for parts and repair costs, barely, thanks in part to the really, really big user base.
Same with aftermarket. MX5 aftermarket is unbelievable. E85 somewhat less so. In fact, nearly invisible by comparison.
Z feels like an MX5 that found an extra 100 hp and gained an extra 500 lbs. The weight is not as significant as the hp. No stock MX5 runs like that; at least none in your price range. Expecting MX5-like urge, I practically needed clean shorts the first time I blew through 140. Then again, $1000 worth of turbo hardware finds that extra 100 hp and then some in the MX5, making it feel in extreme cases like a hand grenade with the pin rolling around loose. I've driven a really pushed hard, blown MX5 and it certainly requires the driver to pay attention.
MX5s are ubiquitous, found on every street corner. Z's, not so much. People ask me what it is and how old. You'd think by now... Anyway, the Z has the "wow" factor hands down.
MX5 uses a timing belt, a 4-6 hr job every 60k miles, <$200 worth of parts. Not all that much fun, but not awful. If you are average or better mechanic, you do it before lunch and go for a drive after. Still, it's something to consider. When shopping MX5s, ask specifically about this, because if you pay to have it done, the possible cost advantage disappears.
The MX5 can turn inside anything except maybe a go-Kart. The Z might, but it's more work.
Everything on the Z is expensive electronic, and comes with three motors and a solenoid, all unique. When something truly fails, you're hosed. Plus, replacement spares invariably need to be somehow introduced to your car via external electronics, you can't just order up a replacement module and expect it to work. The price of that luxury, I guess.
Like everybody says, look at the individual cars closely, look at the maintenance history; that's probably more important that the generalities, especially with the MX5 because I doubt that one more than 3 years old exists that hasn't been modified.
Closing with a joke that may get me banned but that sort of highlights the difference...
A Prius and a Challenger were comparing notes in the garage one night. Boasted the Prius, "I get 39 miles per gallon!" What do you get?"
The Challenger replied, "Pussy."