Preheat the oven to 425 degrees F (220 degrees C).
Heat 2 tablespoons oil in a skillet over medium heat. Increase heat to high and add mushrooms. Cook and stir until golden brown, 6 to 8 minutes. Do not cook so long so that they begin to release a lot of liquid. Add sour cream, mix well, and transfer mixture to a casserole dish.
Heat remaining 2 tablespoons oil in a second skillet over medium heat and cook onion until soft and translucent, 4 to 6 minutes. Distribute onions over mushrooms and season with salt and pepper. Sprinkle with Gouda cheese.
Bake in the preheated oven until the cheese has melted and is golden brown, 15 to 20 minutes.