Preheat your oven to 350°F (175°C).
In a large mixing bowl, combine cream cheese, sour cream, and mayonnaise until smooth.
Stir in the chopped spinach and artichokes.
Add minced garlic, Parmesan, and mozzarella cheese to the mixture.
Season with black pepper and red pepper flakes if using.
Mix all ingredients thoroughly until well combined.
Transfer the mixture to a baking dish and spread evenly.
Bake in the preheated oven for 20-25 minutes, or until bubbly and golden on top.
Remove from the oven and let cool slightly before serving.
Serve warm with chips or toasted bread for dipping.