It is safe to eat 5 day old leftovers as long as the leftover foods have not actually spoiled.
If the 5 day old leftovers have been kept refrigerated or frozen and show no signs of spoilage like mold, bad smell, slimy texture then it's likely safe to eat.
I've eaten some leftover foods that were frozen for 6 months and they were okay.
Leftovers in the fridge can also last around a week or sometimes longer if kept refrigerated and sealed properly.
Cooked meats that are kept refrigerated can last around 7 days in the refrigerator.
Before eating the 5 day old leftovers, smell the food and look closely at it and if it shows no signs of mold or fuzz, bad smell or slime or for some foods, if it doesn't look separated or watery like noodles that may turn watery or smell bad then the 5 day old leftovers are often good to eat.
But if it smells bad, has mold or any fuzz or discoloration of the foods then the 5 day old leftovers should be thrown out.
If you're in doubt about the food being spoiled, you should throw it out and not risk your health.