It looks like the relationships go both ways. Maybe this is an error, or maybe this system has the option to be friends with someone without them being your friend back.
Assuming the latter, you would need only to look at one of the columns, so your query could look like this:
select
rel2
from
YourTable
where
rel1 in (1, 5)
group by
rel2
having
count(*) > 1
The count is obviously there to select only those friends that have more than one friend in the set (1, 5). The assumption is that the combination of rel1 and rel2 is unique.
If the data is indeed incorrect, you could 'solve' that by using a union on two queries on this table, to select all combinations. But mind, if this is the case, you'd better fix the data, because as you can see, your queries will quickly become unreadable (and slower, of course) if they need to fix your data.
select
rel2
from
(select distinct
rel1, rel2
from
(select
rel1, rel2
from
YourTable
union all
select
rel2, rel1
from
YourTable) x ) y
where
rel1 in (1, 5)
group by
rel2
having
count(*) > 1