Most OS:es support selecting which source address to use for a given
route. In Linux one uses the "ip ro" command to access these aspects
of routing.

You could also use the extended tcp_outging_address functionality of
Squid-2.5 to select different outgoing addresses based on request
data, such as the destination IP.. (even if routing is a better
approach when your only criteria is destination IP)