Assuming that you are the Project Manager (otherwise, why would you post this to our site), you have no "right" to disclose this information to your team, since it was told to you in confidence.
Your task as PjM is to ensure the project will be in a deliverable state by the "firing deadline" and that everything is well enough documented to hand it over to the "survivors" of the layoffs.
While this is true in general, we all know that in reality the "handover" aspect of a project is usually ignored, since we prefer to deliver things rather than plan for disaster.
The approach you should take is one of "Crisis Control" and make it clear to the team that this project must survive even if all of them do not. You could "play Covid-19" or use any other excuse why suddenly you are being paranoid about this project.
So "Management has decided that we will use this project as a showcase for Disaster Management" may be the type of line you would want to take.