1. Oil a 1-1/2- to 2-quart gratin dish or any oblong baking pan. Heat the oven to 400 degrees F.
2. Put 2 tablespoons of the oil in a skillet over medium-high heat. When hot, add the onion and garlic and cook until just beginning to soften, about 5 minutes.
3. Put the zucchini slices on a baking sheet, drizzle with the remaining 2 tablespoons oil, and sprinkle with salt and pepper. Transfer to the oven and roast until just tender, 5 to 8 minutes. Reduce the oven temperature to 350 degrees F.
4. Put the stock and tomato sauce in a medium saucepan over medium heat and bring to a gentle bubble. Stir in the couscous and turn off the heat; let sit for about 10 minutes.
5. Spoon a thin layer of the tomato sauce mixture into the bottom of the prepared pan and top with zucchini slices and then a portion of the ricotta. Repeat the layers until you have used up all the ingredients, finishing with the tomato sauce. Bake the casserole until it's bubbling along the edges, about 25 minutes. Serve hot, sprinkled with Parmesan cheese if you like.