Preheat your oven to 375°F (190°C).
Cook the pasta according to package instructions until al dente.
In a large skillet, heat olive oil over medium heat. Add chopped onion and sauté until translucent, about 5 minutes.
Add minced garlic to the onions and sauté for an additional 1-2 minutes until fragrant.
Stir in the pumpkin puree, crushed tomatoes, oregano, salt, and pepper. Simmer for about 10 minutes.
Combine the cooked pasta with the pumpkin tomato sauce in a large bowl, stirring until well coated.
Transfer the mixture to a greased baking dish and top with shredded mozzarella and grated Parmesan.
Bake in the preheated oven for 25-30 minutes, or until the cheese is melted and golden brown.
Let the pasta bake cool for a few minutes before serving.