Preheat the oven to 375 degrees. Slice off the top of the sourdough loaf and hollow out the center, leaving a 1-inch border around the edges. Set the bread pieces aside for dipping.
In a mixing bowl, combine the softened cream cheese and mayonnaise until smooth. Stir in the spinach, artichoke hearts, mozzarella, Parmesan, garlic, salt, and black pepper.
Spoon the mixture into the hollowed bread bowl. Place the filled loaf on a baking sheet.
Bake for 25 minutes until the dip is hot and the cheese is melted and lightly browned on top. Let it rest for 5 minutes before serving.