To prepare spinach-cheese layer, in large bowl, mix spinach, ricotta, eggs, dill, nutmeg, salt and pepper. Set aside.
To prepare mushroom layer, in large skillet, saute mushrooms in hot oil. Add thyme and salt. Set aside.
To prepare custard, in medium bowl, whisk together milk, eggs, nutmeg, and pepper. Set aside.
To assemble, oil an ovenproof casserole dish about 11x8x2 inches. Spread half spinach-cheese mixture over bottom of casserole. Top with two matzos, breaking to fit if necessary. Cover with half the mushroom mix. Top with 2 matzos and continue layering, finishing with mushroom mix. Pour custard over. Top with cheese. Cover, refrigerate overnight.
Bake in preheated 350 degree oven for 50 to 60 minutes or until puffy, golden, and cooked in center.