My apologies if you already know this; but, there is a difference between 5G cell service and 5GHz wifi frequency. Certainly, your TMobile gateway is connecting to the sevice via 5G cell service; but, I would be shocked if its LAN wifi settings didn't allow for at least both 5GHz AND 2.4GHz (either each separately or both combined).
This isn't necessarily the manual for your exact Gateway but it is an example of a T-Mobile 5G Gateway that allows both 2.4GHz and 5GHz wifi frequecies (though, if it is your Gateway, they are probably both already enable by default I would guess):
https://files.customersaas.com/files/CvUYJmmeNQwM9W6XY24h3g95.pdf
