Yes because AT&T and T-Mobile both use GSM technology on their phones but the phone might have a restriction on it to only work with T-Mobile sim cards in which case you would have to have the restriction removed. To find out all you have to do is put your sim card in the T-Mobile phone if you can make a call your fine, if you find out that the phone does have a restriction on it you can see if your friend can call T-Mobile and get the "unlock code" to have the restriction removed, if that doesn't work you can google blackberry unlock codes and get it online.