Preheat the oven to 375°F (190°C).
In a large skillet over medium heat, cook the ground beef or turkey until browned. Drain excess fat if necessary.
Add the diced onion and minced garlic to the skillet. Sauté for about 3-4 minutes until the onion is translucent.
Stir in the Italian seasoning, salt, and black pepper. Mix well and remove from heat.
In a greased 9x13-inch baking dish, layer half of the sliced zucchini on the bottom.
Spread half of the meat mixture over the zucchini, followed by half of the marinara sauce.
Sprinkle half of the mozzarella cheese and half of the pepperoni on top.
Repeat the layers with the remaining zucchini, meat mixture, marinara sauce, mozzarella cheese, and pepperoni.
Finish by sprinkling the grated Parmesan cheese on top.
Cover the dish with aluminum foil and bake for 25 minutes. Remove the foil and bake for an additional 15 minutes, or until the cheese is bubbly and golden.
Let the casserole cool for 5-10 minutes before serving. Garnish with fresh basil leaves if desired.