Heat the olive oil in a large skillet over medium. Add the onion and cook until softened and translucent, 3 to 4 minutes. Stir in the garlic and cook another 1 to 2 minutes until fragrant.
Add the spinach in batches, letting it wilt before adding more. Season lightly with salt. Once fully wilted, remove from the heat.
Transfer the spinach mixture to a fine mesh strainer. Press out as much liquid as possible, then wrap the spinach mixture in cheesecloth or several layers of paper towels and squeeze until dry. Give it a rough chop and set aside to cool slightly.
In a large bowl, combine the cream cheese, mayonnaise, chopped artichokes, mozzarella, Parmesan, garlic powder, red pepper flakes, and a few grinds of black pepper. Fold in the chopped spinach mixture until fully incorporated. Taste and adjust seasoning.
Heat the oven to 375°F. Spread the mixture into a baking dish (an 8x8 or similar works well). Top with a generous handful of mozzarella.
Bake until hot and bubbling around the edges and the top is lightly golden, 20–25 minutes. For more browning, broil for 1 to 2 minutes.
Let cool for 5 minutes, then serve warm with toasted baguette slices, tortilla chips, crackers, or fresh-cut veggies.