Wash and peel the pumpkin. Grate Parmesan on the finest grater. Cut the mozzarella into slices and dry. Preheat the oven to 180 degrees.
Cut the pumpkin into slices no larger than 1 cm. Bread each slice with flour. Place the slices on a baking sheet and top with oil and salt. Place the pumpkin in the oven for 10 minutes.
Separately, grease the baking dish and place a layer of pumpkin slightly overlapping. Top with mozzarella and sprinkle with Parmesan. Make another layer with pumpkin and cheeses. Finish with a layer of pumpkin and a sprinkle of Parmesan cheese.
Cover the pan with foil and place in the oven for 20 minutes. Then remove the foil, increase the oven temperature to 200 degrees and bake for 5-7 minutes.
Before serving, cut into portions. Serve with vegetables, herbs and a slice of lemon.