Preheat the oven to 375°F (190°C).
Heat olive oil in a skillet, sauté garlic until fragrant. Add marinara sauce and simmer for 5 minutes.
In a bowl, mix ricotta, egg, Parmesan, basil, salt, and pepper.
Spread a thin layer of sauce in a baking dish. Layer zucchini slices, ricotta mixture, mozzarella, and more sauce.
Repeat layers until ingredients are used up, ending with sauce and mozzarella on top.
Cover with foil and bake for 25 minutes. Uncover and bake another 10-15 minutes until bubbly and golden.
Let it rest 10 minutes before serving.