On any IP system, doesn't matter Mitel, Avaya, Nortel, ShoreTel - etc, etc,
The phone must be able to reach the controller to work. How this is done depends on the manufacturer but on a Mitel you need some type of gateway to do this. The gateway allows an external device access into your private network, i.e. the network your phones are on.
Another way to do this is to set up a VPN between whatever network you are on and your private network.
In general, if your controller has an IP address that starts with 192.168 or starts with a 10, you won't be able to do what you are trying to do with out a gateway. I'm not sure on this since I'm a 3300 tech (not 5000) I think you will need to add a Mitel Border Gateway controller.
Ralph