The long run is an endurance effort, not a speed effort, but if you race hard with a 5k or 10k you could find yourself too tired/sore to run the next day. Same could be true with putting your long run fewer than 2 days before your 5/10k, your race performance could suffer. It might come down to which is more important to you and how often you are going to race at the same time.

So, you have a few options....
1. Move your long run day to at least 2 days before your Sat/Sun race (Thu/Wed, as suggested). Might mix up your schedule, or you could just consistently shift your schedule so that your long runs fall mid-week if your other schedule can handle that. Probably more doable with a HM than a full marathon, so this might work well. If I do this, I do long run, rest day, easy endurance run, race day. You could use the "race day" in place of a tempo or intervals run so you don't really lose anything.
2. Do your long run the same day as the race - but account for the intensity of the 5/10k as different than your normal long run. You might be slower or need to shorten your long run distance. Not a bad option but I tend to get caught up in races and this never goes according to plan. You could do it later in the day which has the advantage of teaching you to run tired
3. Do your long run the next day. Your legs will be tired so your psychological self might suffer (I feel slow, I am slow, this hurts, I hate running, what am I thinking ). Straightforward otherwise, though.
4. Skip a day then do your long run. Might mess up your following week's training schedule, but you could swap days or put in an extra rest day (or put in a ride instead - good for recovery - and consider it 60% the miles of a run, something like that).

Really you have 3 key runs a week - tempo/race pace, long run, intervals/hills - so as long as you squeeze them in you can play with any training plan and your schedule to make it work.