Heat the olive oil in the 2.5-quart saucepan over medium-high heat. Add the rosemary sprigs and fry until fragrant and the leaves are crisp, 1 minute. Using tongs, remove the rosemary and transfer to paper towels to drain. If any leaves are left behind in the oil, remove with a slotted spoon and transfer to the paper towels as well.
Return the pan with the oil to medium heat. Add the onions and cook, stirring occasionally, until soft and caramelized, 20-25 minutes.
Add the garlic and cook for 1 minute, until fragrant.
Stir in the spinach and cook for 2 minutes to evaporate any excess moisture. Add the cream cheese and cook, stirring, until completely melted and incorporated into the onions and spinach.
Remove the pan from the heat and stir in the sour cream, mayonnaise, lemon zest, salt, pepper, and lemon juice. Let cool to room temperature or cover with plastic wrap and refrigerate for up to 2 days.
Remove the rosemary leaves from the stems over a cutting board. Crush with your fingers or finely chop with a knife.
Transfer the dip to a serving dish and smooth the top. Sprinkle with the fried rosemary and serve with pita chips, toasted bread, or crudités.