Preheat (optional). Heat oven to 375F if you want to bake and serve bubbly (recommended).
Cook bacon. In a skillet over medium heat, cook bacon until crisp. Transfer to a paper towel–lined plate. Leave about 1 tablespoon bacon fat in the pan (discard extra if needed).
Sauté aromatics. Add onion to the skillet and cook 3 to 4 minutes until softened. Add garlic and cook 30 seconds.
Cook spinach. Add spinach and cook until fully wilted (or warmed through if using frozen). If there’s excess liquid, drain it off. For frozen spinach, squeeze it very dry before adding.
Mix the dip. Reduce heat to low. Stir in cream cheese until melted and smooth. Stir in sour cream, mozzarella, Parmesan, pepper, and red pepper flakes if using. Add bacon and mix.
Bake (optional). Transfer to a small baking dish and bake 10 to 12 minutes until hot and bubbly. Broil 1 to 2 minutes for a golden top.
Finish and serve. Stir in lemon juice if using. Serve warm with chips, bread, or veggies.