I think your question is very similar to this question:
Basically you just need to created the $wpdb
using the security credentials for your other site. Take a look at my answer on that question and let me know if it does or does not answer your question, and if not why so I might be able to provide a better answer.