If you need to capture them, don't balance the encounter. I did this for the climax of the Slaver series of adventures (A1-A4 for those of you remember the 1e modules). In the original, there's an encounter with 5 of the 9 slavelords - all higher level NPCs - designed to defeat the PCs so they can have a nearly-naked-in-the-dungeon escape scenario to cap off the series. In the supermodule treatment, it had been upgraded to encountering all 9. Optionally, the DM could have them gassed as the encounter is about to start, by fiat-laden trap.
I was never fond of the trap fiat, so when I ran it, we played out the fight. I think one of the slavelords may actually have gone down but the others took the PCs down handily. I think I only revealed 5 or 6 of the ones present - the rest were in various forms of concealment. I also greased the wheels a bit and did hit them with a gas at the beginning of the encounter - it did a little Dex damage but also gave them some non-lethal hit point damage - providing a buffer to prevent unnecessary deaths by hit point loss. I had totally stacked the encounter against PC success, albeit in ways realistic as far as the NPCs were concerned, and then ran it fairly from that point. They were captured.
One point I'd like to make here is that if you feel the PCs need to be captured for story reasons, you should ideally do it from the point of view of the NPCs who want to do the capturing and then do what they would do to achieve that result. Don't hold back as if you need to balance the encounter like a game. That's not what the NPCs would do. If the NPCs want the PCs bad enough, they'll go after them with all the force they can muster. They'll overwhelm if they can. They'll attack when they feel they have the advantage.