How does TCP manage to discard segment received from a source other than the one with which the connection has been established?
"Stripped away" is not strictly correct. A TCP packet is an IP header followed by the TCP-specific data. The IP-level information is needed, and used. In particular, the source IP address is needed (as you say) to decide which currently open TCP conversation should receive the packet that has just arrived.