Wait 3-6 months and re-evaluate. It sounds like a great environment with a lot of upsides. You don’t want to trade a terrible team for 5% more where you commute in each day. If after 3 months you still want to change jobs, start looking. You might be in a spot of feeling under appreciated today but feel differently soon
As you mostly change jobs every couple of years, I’d say you should be looking for way more than 5%. Unless you are at the top of your pay scale, in which case it’s not worth moving for money, certainly not 5%.