Is it possible to JOIN to a Primary database from a Replication instance?
You should use linked server and use four part naming linkedservername.dbname.schema.object

Also refer my answer on efficient way of pulling data when using linked server