Preheat the oven to 375°F (190°C) and lightly grease a baking dish. Heat the olive oil in a skillet over medium heat.
Cook the onion for about 3 minutes, then add the garlic and spinach. Stir until the spinach has completely wilted, then remove from the heat.
Whisk together the eggs, milk, oregano, salt, and pepper until well combined.
Stir the spinach mixture, feta, and mozzarella into the eggs. Mix gently, then pour everything into the prepared baking dish.
Bake for 35 to 40 minutes, until the center is set and the top is lightly golden.
Let the casserole cool for 10 minutes before cutting into squares. Serve immediately or cool completely before freezing.