How can I find the Database ID of a deleted database?
You could inspect the default trace to see the database id for a deleted database, assuming the database was deleted recently enough for the drop to be captured in the trace.

This T-SQL will show you the trace records:

DECLARE @trcfilename VARCHAR(1000);

SELECT @trcfilename = path 
FROM sys.traces 
WHERE is_default = 1;

IF (SELECT COALESCE(OBJECT_ID('tempdb..#trctemp'), 0)) &lt;&gt; 0
BEGIN
    DROP TABLE #trctemp;
END

SELECT *
INTO #trctemp
FROM sys.fn_trace_gettable(@trcfilename, default) tt

SELECT tt.DatabaseID
    , tt.DatabaseName
    , tt.StartTime
    , tt.HostName
    , tt.LoginName
    , tt.ApplicationName
FROM #trctemp tt
WHERE tt.eventclass = 47 
    AND tt.objecttype = 16964
ORDER BY tt.StartTime DESC;