If the databases are on the same SQL Server instance but on different databases, you need to use three part naming when referencing the table The syntax is
[database name].[schema].[table name]
If the schema is dbo you don't need to specify it. Otherwise schema is commonly needed.
So taken that the schema is dbo, your example query could look something like
SELECT t1.column1, t2.column1, t1.column1 - t2.column1 AS calculation
FROM DB1..TB1 t1
INNER JOIN DB2..TB2 t2 ON t1.column1 = t2.column1