Bring a large pot of salted water to a boil and cook the ziti until al dente. Drain and set aside.
Heat the olive oil in a large skillet over medium heat. Add the diced onion and cook until softened, about 5 minutes.
Add the minced garlic and cook for 1 minute until fragrant. Add the Italian sausage, breaking it up with a spoon, and cook until browned.
Stir in the marinara sauce and let it simmer for 5 minutes. Season with salt and black pepper to taste.
Preheat the oven to 375 degrees. In a large baking dish, combine the cooked ziti with the sausage sauce mixture.
Sprinkle half the mozzarella and Parmesan over the pasta, then stir gently to distribute. Top with the remaining mozzarella and Parmesan.
Bake uncovered for 20 to 25 minutes until the cheese is melted and lightly browned on top. Let it rest for a few minutes before serving.