Place the eggplant slices in a colander, sprinkle with salt, and let them sit for 20 minutes to draw out moisture. Rinse and pat dry with a clean towel.
Preheat the oven to 400°F. Brush both sides of the eggplant slices with olive oil and arrange them in a single layer on a baking sheet. Roast for 20 minutes, flipping once, until the slices are soft and lightly golden.
Spread 1 cup of marinara sauce in the bottom of a 9-by-9-inch baking dish. Add half the roasted eggplant slices in a single layer.
Spoon another cup of marinara over the eggplant, then scatter 1 cup of mozzarella and 1/4 cup of Parmesan on top. Repeat the layers with the remaining eggplant, marinara, mozzarella, and Parmesan.
Bake uncovered for 25 minutes until the cheese is bubbly and starting to brown. Remove from the oven and let the casserole rest for 10 minutes before sprinkling with torn basil.