Can a creature be too stupid to know whether the companions of the person charming it are companions?

This is D&D 5e. So we were attacking a baddie. The wizard cast charm monster and charmed it. It has an intelligence of 4. Is it smart enough to know that the other parties members are in fact companions of the wizard?