Roy is right.
5 metres is right at the limit of how far USB signals can travel without dispersion leading to an unacceptable error rate. So you really need to have something on the end of the cable acting as a repeater.
An active USB cable does exactly this: there’s a small repeater in the plug furthest from the computer. I’ve used cables like this and they seem to work.
I imagine that plugging the far end of a passive 5m cable into a powered (or even unpowered) hub would have the same effect, but I’ve not tried it.