There is two ways you can play this out successfully and it depends on your players which one is the appropriate one:
With good role players, just tell them. They don't recognize each other, so they fight. With good roleplayers, the level of meta gaming should be minimal and a good fight should happen, where everybody is openly playing his character, fighting for his perceived side, against the others, that just happen to be characters as well.
But there are people and groups that are not that good in keeping meta knowledge from influencing their gameplay. This might be a good learning opportunity if you try the above and explain what you expect. But in case this has a low probability of working out because their playstyle is not exactly role playing but more like roll playing, there really is no way to pull it off without physically separating the knowledge. And that means the players.
Separate the two groups when they actually get separated in-game. Put one group in another room. This has the added benefit that for the time you are not with them, they can do stuff without disrupting the gameplay of the respective other group. Whether they discuss gameplay or switch on the gaming console when the DM is out of the room, it's their thing and won't bother the active part of the group.
For the actual combat, you need to have one initiative for the whole group or it will be too tedious. Have one turn play out in the one room, then switch rooms, play the "NPC" turn (repeat what just happend in the room you left) and then let them play their turn. Repeat until they recognize each other and invite one group over into the other room so you are united again, both as players and as characters.
We did this very successfully many times back in school when we had whole weekends to play and having the DM in the other room with half the players was no problem when you could try to beat your fellow players at Tekken for an hour or so. But be aware, this needs both real estate and commitment. Today, with limited time on my hands as an adult, I would maybe not be too happy if I made time for role playing and then had to play console games for half of the evening instead. Make sure you have both another room and the consent of your players when you do this.
Back in school we played 2e, now it's 5e, they are very similar. With other systems that have more "reactions" where your players can make decision even in other peoples combat turns, this might be problematic, but with 5e it should be fine.