###"Companion" isn't a game term, so it uses its standard English definition
"Companion" isn't a game term, so it uses its standard English definition
In the context of 5e, "companion" doesn't have any exact rule or definition. With that in mind, Merriam-Webster defines a companion (in this context) as:
one that accompanies another. also : one that keeps company with another
So, "companion" refers to anybody who is traveling with you. In a fight, it's your friends; or the people with whom you are allied. That is, the people on your side. If the friendly NPC is traveling with you (keeping company with you) then they are your companion and they could break the charm. Yes, that might give you one more obstacle to work around, but it shouldn't be any more of a hindrance than if you had another PC in the party.
You could try to keep the relationship a secret
###You could try to keep the relationship a secret JustJust like in the real world, you can hide your relationships with other people. Secret affairs and interactions are not unusual. However, just because I try to convince somebody that I don't know my best friend doesn't change the fact that we are actually friends in reality.
So even though you can try to lie to the people around you and claim that you are not friends or a companion of somebody else, the DM is the one who gets to make the final call. And if they think you two are companions, then you are companions as far as the game is concerned.
###If the DM leverages that to ruin every charm spell you use, then you need to have a conversation
If the DM leverages that to ruin every charm spell you use, then you need to have a conversation
A friendly NPC is just that; friendly. Just like any PC, unless they have some deep character motivation to act against your use of charming spells, they would do their best not to disrupt your spell. Especially if they are in on the plan to suggest/charm a given target.
By that reasoning, if the DM is using NPCs to ruin your charm spells just for the sake of keeping your charm spells from working, then that DM is being adversarial. In that case, it might be worth talking to them about why they won't let you use these kinds of spells.