I never figured out how to control those mindflayers. Think I got the right equipment but simply forgot about the whole thing in chaos of the place. Thankfully there was another way to open the doors, though there are downsides to that trick....... I did it though, twice.
The room off to the right (where you get the liquid to wake up the slaves) has a respawning Mind Flayer in it. After you've freed the slaves, you can use the slave machine to make 4 control collars. The collars will allow you to charm any Mind Flayer, but it's easiest to get the respawning one as he's alone and you can easily sneak up on him. Then just walk him over to the doors that need opening, and voila!
As for actually fighting them, Mind Flayers are why I always stockpile potions of Genius and Mind Focusing earlier in the game. I use a character in full plate + shield, use Chaotic Commands/Greenstone Amulet/Briny Potion, and a stack of those INT-boosting potions, and send them off ahead of the others. That way, the one character can absorb all the psionic attacks (since they're immune) and all the hits (since they have great AC) and everyone else can stand back and launch rocks at them. Hits that manage to get through can be counteracted with the potions, and since the INT drain only lasts 30 seconds but the potions last for hours, you should only need a few of them. Just wait for the drain to go away before moving forward again.