Preheat oven to 375°F (190°C) and lightly grease a 9×13-inch baking dish.
Bring a large pot of salted water to a boil and cook the ziti until al dente. Reserve ¼ cup pasta water, then drain.
Heat olive oil in a skillet over medium heat and cook the ground beef, breaking it up as it browns.
Stir in garlic, salt, and black pepper, then add the marinara or pasta sauce and simmer for 5 minutes.
In a bowl, mix ricotta, sour cream, Parmesan, and 1 cup mozzarella until smooth. Add softened cream cheese if using.
Spread a thin layer of meat sauce on the bottom of the baking dish.
Add half of the cooked pasta, then spread the ricotta mixture evenly on top.
Add the remaining pasta and cover with the rest of the meat sauce.
Sprinkle the remaining mozzarella cheese over the top.
Cover with foil and bake for 20 minutes.
Remove foil and bake for another 10–15 minutes until bubbly and lightly golden.
Let rest for 10 minutes before serving.