Are they used to sleeping in the coop? If so, wait until dark and they may go in by themselves. But they may not. See below.
If they are not used to sleeping in the coop, when it gets dark they will settle somewhere to sleep. At five weeks that’s almost certain to be somewhere on the ground. If it is truly dark, it’s really pretty easy to just pick them up and put them into the coop. If you have a lot of light down there, that gets more challenging.
If they are not used to sleeping in the coop, you can try leaving them locked in the coop until they are used to going to bed in there. They are creatures of habit. Get them in the habit of sleeping in the coop and this problem goes away.
I think you have an added complication. I find that if the coop is raised, chicks that age tend to sleep under the entrance to the coop when it gets dark. Until they learn to roost they seem to seek a low spot to spend the night in a group. That’s on the ground, not in the elevated coop. If the coop is on the ground I just don’t have this problem. They quickly learn to go into a ground level coop. Mine tend to start roosting somewhere around 10 to 12 weeks of age. I’ve had some earlier, some later, but 10 to 12 is about average.
Even if I house mine in my elevated grow-out coop for over a week before I let them into the run associated with it, they still always go to bed on the ground under the entrance. I wait until it is dark to pick them up and lock them inside for the night. Sometimes they learn pretty quickly to go to bed in the coop, but there have been times I had to do this consistently for three weeks before all of them caught on. I have had them learn after one night. They are individuals with individual personalities. They are not consistent. I generally start this training around five weeks of age.