You can prefix table names with the database name to identify two identically named tables. You can then use this fully qualified table name to denote identically named fields.
So, without aliases:
select db1.table1.id, db1.table1.value1, db2.table1.value1
from db1.table1 inner join db2.table1 on db1.table1.id = db2.table1.id
and with pseudonyms
select t1.id, t1.value1, t2.value1
from db1.table1 as t1 inner join db2.table1 as t2 on t1.id = t2.id
, :
select t1.id as id, t1.value1 as value_from_db1, t2.value1 as value_from_db2