Yes, this is often called 'hairpin network address translation', and is usually implemented on the device doing the address translation. This is not exactly the same thing as NAT traversal or hole punching as some other comments implied. You are trying to get two hosts behind the same NAT to communicate with each other.
I would take a look at the link below to see the various NAT implementation and decide which option will work for you. Here is a diagram and link for you:

http://www.cisco.com/web/about/ac123/ac147/archived_issues/ipj_7-3/anatomy.html
If you need this to be implemented on the client software, you may want to look into something like avahi or another 'zeroconf' option for discovering local installations.
http://en.wikipedia.org/wiki/Avahi_(software)