Your question wasn't clear, but it seems you wanted numbers that weren't present in the range returned by two queries, but fell within that range. For that, you can use a tally table and a few methods to limit the results. Note, you included 5 in your expected results, but this contradicts your question since you didn't include 1 int he expected results.
declare @table1 table (i int)
insert into @table1
values (1),(3)
declare @table2 table (i int)
insert into @table2
values (5)
declare @max int = (select top 1 i from (select max(i) i from @table1 union select max(i) from @table2) x order by i desc)
declare @min int = (select top 1 i from (select min(i) i from @table1 union select min(i) from @table2) x order by i asc)
;WITH
E1(N) AS (select 1 from (values (1),(1),(1),(1),(1),(1),(1),(1),(1),(1))dt(n)),
E2(N) AS (SELECT 1 FROM E1 a, E1 b), --10E+2 or 100 rows
E4(N) AS (SELECT 1 FROM E2 a, E2 b), --10E+4 or 10,000 rows max
cteTally(N) AS
(
SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM E4
)
select N from cteTally
where
N not in (select * from @table1)
and N not in (select * from @table2)
and N > @min
and N < @max
GO