Preheat oven to 375°F. Lightly grease a 9-inch baking dish or cast iron skillet.
Thaw frozen spinach completely, then squeeze out as much liquid as possible using paper towels or a clean kitchen towel. This step is crucial to prevent watery dip.
In a large mixing bowl, combine softened cream cheese, sour cream, and mayonnaise. Mix with a wooden spoon until smooth and well combined.
Add minced garlic, salt, pepper, and red pepper flakes if using. Stir to combine.
Fold in squeezed spinach, chopped artichoke hearts, 1 cup mozzarella, 1/2 cup parmesan, and green onions using a wooden spoon. Mix until everything is evenly distributed.
Transfer mixture to prepared baking dish, spreading evenly with a spoon. Smooth the top.
Sprinkle remaining 1/2 cup parmesan and 1/4 cup mozzarella over the top for a golden, bubbly cheese crust.
Bake for 25-30 minutes until dip is hot, bubbly around the edges, and cheese on top is golden brown.
Remove from oven and let cool on cutting board for 5 minutes before serving. Serve warm with tortilla chips, pita chips, crackers, or toasted baguette slices.