FWIW, phones aren't designed to last 5 years. The batteries aren't, the screens aren't, the casing isn't, and the hardware generally doesn't (newer software = more demanding).
That said, if you do require to use the same device for five years, and need the latest software on it, than Apple is probably your only option.
FWIW I’m typing this on a 4 year old iPhone and I expect it to easily last another year. Battery was replaced once. Modern smart phones are complex, expensive, ressource intensive assemblies. Swapping them out every 2 years is crazy (... and yet common, sadly)
I have and enjoy the Pixel 2 and plan on keeping it for at least another two years. The Pixel 3 (non-xl) would be an ideal phone if you are moving from iPhone and are looking for a long term, well-supported phone.
Can you make a recommendation here? I am an iPhone user who might be inclined to switch to Android, but I still haven't found a phone that would satisfy this criterion. To clarify: "reasonable" for me means ~5 years, as this is how long I expect to keep using the same phone.