This question has nothing to do with mysqli (or any other API).
To do a join with a table from different database, a user which connects to mysql, have to have SELECT rights for both databases.
Having this done, just select one of databases in your connection statement and address another using usual dot syntax:
SELECT * FROM t1 JOIN db2.t2
To answer your question literally,
Can I use this 2 connections to run a query which joins 2 tables?
You can't
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…