If you want to connect to a different server port (probably won't work unless the server is configured for that) you should first seek the program information. If you can indeed state the port used it should be changeable through the GUI or a command line parameter.
If you want to use your local port 5000 all the time to connect to the regular IRC server port I don't know if that's possible. First, most applications will use any free port in the upper range to establish connections with well-known ports in foreign computers. Also, iptables alone would help since it doesn't recognize which applications are asking for since it only does global policies on ethernet adapters (run on the TCP/IP layer, not application).
The identd service is just a way for the server to know who's connecting to it (although this identity can be easily framed).
|