If using fresh spinach, rinse it thoroughly and chop it. If using frozen spinach, make sure it is fully thawed and drained of excess water.
In a medium-sized pot, cook the spinach over medium heat until wilted (for fresh spinach) or warmed through (for frozen). Drain excess liquid using a colander and set aside.
In a mixing bowl, combine the softened cream cheese, sour cream, mayonnaise, mozzarella cheese, and Parmesan cheese. Mix until smooth.
Add the cooked spinach and minced garlic to the cheese mixture. Season with salt, black pepper, and red pepper flakes if desired. Stir well to combine.
Transfer the mixture to a baking dish and spread it evenly.
Preheat the oven to 350°F (175°C). Bake the spinach dip for about 25 minutes, or until it is hot and bubbly.
Remove from the oven and let it cool slightly before serving. Serve warm with tortilla chips or sliced vegetables.
For added flavor, you can mix in some chopped artichoke hearts or a splash of lemon juice.