The subnet mask, is usually found by checking the ISP the IP that you are pinging, just do a whois on their IP, to find their ISP, and then their default Subnet mask.
The gateway, is usually found by working out what the default modem/router is for that ISP members. Once you find the default modem, you can look up the manual to find the modem's IP login, which is the Gateway.
That's one way to do it. Note: this is assuming that the IP user is using all the default settings and modem.
That's all I'm going to say on this, as it looks a little bit of invasion of privacy.