First rule of shooting stuff while avoiding faction loss: If you're not crouching, the faction will know that you were the one who shot their soldiers. It's not clear whether you did this, so I'll just throw that in.
Faction armor cannot be used to perform actions as if you belonged to that faction; it will only affect how factions react to your presence. Say that you were to put on Any-Faction Armor, and then walk up to a regular Any-Faction Soldier. They wouldn't catch your bluff, but if you were to shoot them (while not crouching), they would know that you did not belong to the Any-Faction, and consequently tick down your standing with the Any-Faction.
As for companions, I usually avoid them as they have a tendency to go guns blazing when you initiate a battle, thus reducing your chances of successfully avoiding faction-standing penalties.