For the last 25 years I've always driven five series. E24's, e34's, e39's, and most recently an e60. The E34 was the last good one, and since then they've been horribly unreliable. I've only been stranded once, but the rate at which parts worn out or failed was astounding. My E60 cost nearly $7k in repairs (not maint) in the four years it spent going from 50k to 100k miles. In comparison, my wife has always had Merc ML's and they have been almost completely reliable. I think we spent less than $2k on repairs for her W164 over 8 years and 145k miles. Her W163 was similarly good, and I believe her W166 will also be head and shoulders more reliable than any BMW five or X5.
That said, the 3-series are generally far far better than the 5-series's.