Preheat the oven to 375°F (190°C). Lightly grease a small baking dish.
Thaw the spinach completely and squeeze out as much excess liquid as possible.
Drain the artichoke hearts and chop them into small pieces.
In a large bowl, mix the softened cream cheese, sour cream, and mayonnaise until mostly smooth.
Add the garlic, half of the mozzarella, half of the Parmesan, salt, black pepper, and optional red pepper flakes.
Fold in the spinach and artichoke hearts until evenly combined.
Spread the mixture in the prepared baking dish and sprinkle the remaining mozzarella and Parmesan on top.
Bake for 20–25 minutes, until hot and bubbly. Broil briefly at the end if you want a more golden top, watching carefully.
Let the dip rest for approximately 5 minutes before serving.
Garnish with fresh parsley or extra Parmesan and serve warm with bread, crackers, tortilla chips, or vegetables.