Preheat your oven to 350°F (175°C).
Cook the spaghetti according to package instructions until al dente. Drain using a colander and set aside.
In a large mixing bowl, combine the softened cream cheese, sour cream, and half of the mozzarella cheese. Mix until well combined and smooth.
Add the cooked spaghetti to the creamy mixture. Stir gently until the spaghetti is evenly coated.
In another bowl, mix the marinara sauce, garlic powder, onion powder, Italian seasoning, and salt and pepper. Stir until well combined.
Layer half of the spaghetti mixture in the bottom of the 9x13 inch baking dish. Spread half of the marinara sauce mixture over the top.
Add the remaining spaghetti mixture and finish with the rest of the marinara sauce. Top with the remaining mozzarella cheese and grated Parmesan cheese.
Cover the baking dish with aluminum foil and bake in the preheated oven for 20 minutes.
Remove the foil and bake for an additional 10 minutes, or until the cheese is melted and bubbly.
Remove from the oven and let cool for a few minutes before serving. Garnish with fresh basil, if desired.