My two-year-old is good for about an hour on things he’s not used to doing. That’s about his “fun limit” and after that he’s just not as engaged until you recharge and switch to something different.
So if it’s just the two of us, I try to find things to do where there’s a high energy part (a playground, or walk, or fort building type activity) and a low energy part (lunch, watching ducks/dogs/people/shows, playing with “cars”) and that seems to make him happiest.
With 5 hours it might be tempting to climb a mountain or head out for a go til you drop fun fest, the kiddo might actually enjoy a play/recharge cycle more.
It doesn’t expand the mind quite like some of the suggestions above, but a restaurant with a playscape is pretty much his idea of heaven right now. Follow that up with a drive with the windows down and one other “go time” activity and he’s ready to curl up in your lap or lay on the floor for a while.
Your kiddo may vary.