When you want to track an IP address from Gmail, you must look at its full email header. The email header consists of information like the sending ID, sending IP, and the other metadata. Therefore by looking at the email header, you can track the IP.