Dust the eggplant with flour, dip in egg and panfry in a non-stick pan in oil.
Drain well on paper towels.
Heat a little oil in a large non-stick pan and gently sauté onion and garlic. Add pasta sauce, wine, pesto and pepper. Bring to the boil and boil for a few minutes to allow the liquid to reduce a little. Season to taste.
Put some of the sauce in the base of an ovenproof casserole dish, top with a layer of eggplant, and then mozzarella and sauce. Repeat this process, finishing with a thick layer of sauce and a sprinkling of parmesan.
Cook in the oven for about 20 minutes. If the dish has been pre-prepared, you will need to cook it for longer, probably 30-40 minutes.