Preheat oven to 375 degrees F (190 degrees C). Lightly grease a 9x13-inch baking dish.
Fill a large pot with lightly salted water and bring to a boil. Stir in ziti pasta and return to a boil. Cook pasta, stirring occasionally, until cooked through but still firm to the bite, about 11 minutes; drain.
Combine egg, ricotta cheese, and 1/4 cup Parmesan cheese in a bowl. Spread 1/3 the spaghetti sauce in prepared baking dish. Top with 1/2 the pasta, 1/2 the ricotta mixture, 1/3 the spaghetti sauce, 1/2 the mozzarella cheese, and 1/2 the Parmesan cheese; repeat layers. Top with remaining spaghetti sauce and Parmesan cheese; cover baking dish with aluminum foil.
Bake in preheated oven until heated through, 45 to 50 minutes.