The type of phone isn't what you need to know to determine if you can use a phone with a specific carrier/service provider. What you need to know is what carrier/service provider was the phone originally set to be on? Basically if the phone is CDMA or GSM. If you can't find that out directly , then you need to contact t-mobile and have them look into the phone to see if it can work on their network.
BTW T-Mobile, like AT&T, is a GSM network.