Cook the pasta according to package instructions until al dente.
Preheat the oven to 375°F (190°C).
In a large skillet, sauté the chopped onion over medium heat until translucent.
Add minced garlic to the skillet and cook for an additional minute.
Stir in pumpkin puree, diced tomatoes, oregano, basil, salt, and black pepper.
Let the sauce simmer for about 10 minutes, stirring occasionally.
Combine the cooked pasta with the sauce in a large mixing bowl.
Transfer the pasta and sauce mixture to a greased baking dish.
Sprinkle mozzarella and Parmesan cheeses on top of the pasta.
Bake in the preheated oven for 25-30 minutes, until the cheese is bubbly and golden.
Let it cool for a few minutes before serving.