Whisk together the onion, garlic, thyme, white wine, and olive oil in a large bowl. Add the mushrooms and toss to coat; season to taste with salt and pepper.
Transfer mushroom mixture into a small baking dish, cover, and bake for 35 minutes, stirring occasionally.