Preheat the oven to 375°F (190°C). Lightly grease a 9-inch baking dish with cooking spray or a little butter.
Thaw the frozen spinach completely and squeeze out as much excess moisture as possible using a clean kitchen towel or paper towels. Chop the drained artichoke hearts into small, bite-sized pieces.
In a large mixing bowl, combine the softened cream cheese, sour cream, and mayonnaise. Stir until the mixture becomes smooth and creamy.
Add the minced garlic, salt, black pepper, and red pepper flakes if using. Mix until the seasonings are evenly distributed.
Stir everything together until the spinach and artichokes are evenly coated and the cheese is well distributed.
Spread the mixture evenly into the prepared baking dish. Smooth the top with a spatula, then sprinkle the remaining ¼ cup mozzarella cheese over the surface.
Place the baking dish in the preheated oven and bake for 20–25 minutes, or until the dip is heated through and the cheese is melted and bubbling around the edges.
For a more golden top, broil for another 1–2 minutes, keeping a close eye on it to prevent burning. Remove the dip from the oven and let it rest for about 5 minutes. This helps it settle slightly while keeping its creamy texture.
Serve warm with toasted baguette slices, crackers, pita chips, or fresh vegetables.