Bring a large pot of salted water to a boil and cook the ziti until al dente according to package directions. Drain and set aside.
Heat the olive oil in a large skillet over medium heat. Add the sausage and cook, breaking it up with a spoon, until browned and cooked through, about 6 minutes.
Add the onion and mushrooms to the skillet. Cook until the onion softens and the mushrooms release their liquid, about 5 minutes. Stir in the garlic and cook for 1 minute more.
Pour the marinara sauce into the skillet. Season with salt and pepper, then simmer for 3 minutes. Remove from heat.
Preheat the oven to 375°F. In a large bowl, combine the cooked ziti with the sausage mixture and ricotta cheese.
Spread half the pasta mixture into a 9x13 baking dish. Sprinkle with half the mozzarella and Parmesan. Add the remaining pasta mixture and top with the rest of the cheeses.
Bake for 20 minutes until the cheese is melted and bubbling at the edges. Let rest for 5 minutes, then sprinkle with fresh basil before serving.