Preheat your oven to 375°F (190°C).
In a large skillet, heat the olive oil over medium heat.
Add the chopped onion and cook until translucent, about 5 minutes.
Stir in the minced garlic and cook for an additional 1 minute.
Add the sliced mushrooms to the skillet and cook until they release their moisture and begin to brown, about 8-10 minutes.
Stir in the dried oregano and dried basil, and cook for another 1-2 minutes.
Add the diced tomatoes and marinara sauce to the skillet, stirring to combine. Season with salt and pepper to taste.
Simmer the mixture for 5 minutes, allowing the flavors to meld together.
In a medium mixing bowl, combine the shredded mozzarella and grated Parmesan cheeses.
Spread half of the mushroom mixture evenly in the bottom of a 9×13 inch baking dish.
Sprinkle half of the cheese mixture over the mushroom mixture.
Layer the remaining mushroom mixture on top, followed by the remaining cheese mixture.
Bake in the preheated oven for 20-25 minutes, until the cheese is melted and bubbly and the top is golden brown.
Remove from the oven and let cool for a few minutes before serving.