I imagine your subnets are assigned to (virtual) interfaces and that you want the trace to go through one of these.
The traceroute
has an option for this. Check out the man page - you just do this to force the trace to proceed through a specific interface:
traceroute -i <interface> <host>
If this doesn't work, out can add a specific route to the host you want to trace via the gateway you want. Do:
route add -host <host> gw <gw>
Then do the traceroute - and don't forget to delete the route (if you don't need it anymore):
route del -host <host> gw <gw>
Hope it helps.