Preheat your oven to 350 F (180 C).
Remove the thick stems from the mushrooms, then chop the stems roughly.
Place the mushrooms caps into a baking dish.
Heat a large frying pan over high heat. Add the olive oil. Once the oil is hot, add the onions.
Once the onions are translucent (about 5 minutes), add the chopped mushroom stems and cook for another 3 minutes.
Add the garlic and cook until fragrant, about 1 minute.
In a large bowl, mix together the cooked stems and onions, cream cheese, mozzarella, salt, and pepper.
Stuff the mushrooms caps with the mixture.
Place the mushrooms in the oven and bake for 20 minutes or until the cheese is melted and golden.