I had a similar (sorta) experience that is rather funny. So forgive me as I tell you a story before the answer.
I worked as a consultant to a global organization that everyone will recognize. For that reason, I will not mention it. Within this organization, a consultant is not a contractor. Consultants are held with very high esteem and afforded all of the privileges the organization affords all upper management including having teams of employees below them.
We worked on a unique system that allowed communications and advanced tools for governments and our users where Kings, Presidents, Ambassadors, and anyone with the highest positions in country governments around the entire globe. This was a secure communication channel and handled very sensitive data. It comprised of systems and applications that required skill sets that normally one person would not have. Indeed, with only one person holding these skills world-wide and not within our group, we began training a new employee with these skills.
The only person with the skills identified worked on another system within the organization where he was very busy. He often worked late and his skills and work was outstanding.
His manager was replaced with someone without adequate skills to understand the system they were in charge of. It was the new managers assumption that the work required half of the hours currently expended and that the only person with the skill set ready to do the work, was indeed incompetent. Nothing was further from the truth. The new manager did not keep their opinion to themself and the one person with the skills began looking for another position with the belief that his days within the organization was limited. This, sadly, was a fact.
The new manager placed an ad in the Washington Post for the skill set required without giving out any identifying information as to the company which was the norm in those days. It ended up the one being fired applied for his own job. I told him what he had done to his embarrassment.
The person being fired was a friend of mine. My group often collaborated on technical solutions between the two systems prior to the arrival of the new manager.
And so I had an idea. [insert evil grin]
I hired my friend into my group secretly to begin immediately upon his termination. This was a no-brainer since we could use the help and my friend was absolutely the best technical expert in the matter. I also proposed to the new manager that we contract my group for the set number of hours, part-time, to service the other systems requirements. When the contract between the two groups was signed, the new manager fired my friend who simply walked over to his new desk across the street.
It gets worse.
We never specified how we were going to satisfy the new contract. [insert another evil grin] The employee to do the work was the same employee who had always done the work. You guessed it. While my friend changed desks, his work did not change, it was only part-time. The rest of the time he worked on our system. I am a stinker!
Why did I tell you this story?
Besides that it is funny, the new manager was rather poor. No question. But what was important was that I could trust telling my friend what was going on. Why? Because he knew that I had his back. He also knew that I would not betray him. I also knew he would not betray my trust. I could trust him completely. He epitomized the terms gentleman and professional.
If you can trust your friend absolutely not to betray your trust, then telling him could be an option. He could simply be a gentleman and go through what is often a painful experience with grace and honor. Telling him can also smooth the way to a friendship that lasts. My friend and I remained friends and eventually we both found other things to do. The trust we built lasted well beyond the experience through many years. Sometimes trust and honor are what is most important. If you have it, spend it. But spend it wisely.