[en] Cyber security for 5G and Beyond (5GB) network slicing is drawing much attention due to the increase of complex and dangerous cyber-attacks that could target the critical components of network slicing, such as radio access and core network. This paper proposes a new cyber defense approach based on two-layer Federated Learning (FL) to protect 5GB network slicing from the most dangerous network attacks and a mean-field game to safeguard the FL-enabled defense system from poisoning attacks. Our proposed distributed defense systems cooperate, intending to detect internal and external attacks targeting the critical components of 5GB network slicing and detecting infected parts in the 5GB defense system. Our experimental results show that our cooperative defense systems exhibit high accuracy detection rates against network attacks, namely (distributed) denial of service and botnets while being robust against poisoning attacks and requiring a few overheads generated by defense systems. To the best of our knowledge, we are the first to propose lightweight and accurate cooperative defense systems based on two-layer FL and non-cooperative games to enhance security against attackers in 5GB network slicing.