Logins table:
+---------+------------+
| user_id | login_date |
+---------+------------+
| 1 | 2019-07-20 |
| 1 | 2019-07-20 |
| 1 | 2019-07-20 |
| 2 | 2019-07-20 |
| 2 | 2019-07-21 |
| 2 | 2019-07-21 |
| 3 | 2019-07-21 |
| 3 | 2019-07-21 |
| 3 | 2019-07-21 |
| 4 | 2019-06-25 |
| 4 | 2019-06-25 |
+---------+------------+
select
distinct a1.id, a1.name
from `Accounts` as a1
inner join (
select
id,
@cnt:=if(@id=id and @pre_date=date_sub(login_date, interval 1 day), @cnt+1, 1) as cnt,
@id:=id,
@pre_date:=login_date
from
(select * from `Logins` group by id, login_date order by id, login_date) as a,
(select @id:=null, @pre_date:=null, @cnt:=0) as b
) as b1
on a1.id = b1.id
where b1.cnt >= 5
order by a1.id