I don't think T-Mobile ever sold the iPhone 5, so they would not be the ones to unlock it. If it was supposed to be unlocked when you bought it, I'd take the issue up with the person from whom you bought the phone.
For phones T-Mobile sold, here are the unlock policies: Unlock your mobile wireless device
Need our help? Contact us.