You would have to jailbreak it and unlock it, and like jeffrey101 mentioned, you need a compatible baseband.
I don't think it will work for the iOS 5 currently because there's no jailbreak for that yet.
When I jailbroke my 3GS, I noticed the unlocking/jailbreaking was different than iPhone 4 (easier than 3GS). So hopefully someone else can fill you in with more details.
But right now, check what iOS you have now and the baseband and use this to see what process you can use:
google iclarified jailbreak wizard (I have below 10 posts right now so I can't post the link)