Send them a link to a page on your web server. Once a visitor clicks on the link, your web server's access logs will record their IP address.
It's also possible to put an image on that web server and deceive users into thinking they're accessing it from a different website entirely. You may post HTML code, including image tags, to some social networking sites.
When I say "their IP address," I'm talking to the address after any NAT or proxying, not the original address.
You can view each other's IP address if the protocol employs P2P communication (straight from you to him). As an alternative, you'll see the server's IP address. With the netstat command, you may see the IP addresses of all of your current connections.