If using fresh spinach, bring 1 inch water to a boil in a 6- to 8-quart pot over high heat. Add spinach, a few handfuls at a time, and cook, turning with tongs, until wilted, about 3 to 5 minutes. Drain in a colander and rinse under cold water. You may skip this step if you like, I don't think it's really necessary.
Thoroughly squeeze cooked fresh or thawed frozen spinach in small handfuls to remove excess moisture(try to get it absolutely dry), then coarsely chop and transfer to a bowl.
Melt 3 tablespoons butter in an 8-inch heavy skillet over medium low heat, then cook onion and garlic, stirring, until softened, 3 to 5 minutes(you can cook it till caramalized if you like). Add onion mixture to spinach along with salt, pepper, nutmeg, and cream and stir to combine.
Put oven rack in upper third of oven and preheat oven to 400°F Butter a 3-quart shallow baking dish (13 by 9 inches; not glass-I think you could use glass, just be careful when broiling-that's the reason it's not recommended).
Cut squash to separate bulb section from solid neck section, then cut pieces lengthwise into 1/8-inch-thick slices with slicer or food processor. To make the squash easier to cut, microwave for 3-5 minutes.
Layer squash and spinach mixture in baking dish, using about one fifth of squash and one fourth of spinach for each layer, beginning and ending with squash. Sprinkle each layer of squash evenly with cheeses and dot with remaining 2 tablespoons butter, then cover directly with a sheet of parchment or wax paper(or use glass lid). Bake until squash is tender and filling is bubbling, 35 to 45 minutes. If you like, you can use individual baking dishes, just note shorter cooking time. I haven't tried baking it individually so cook times are estimated.
Remove paper and bake gratin until browned in spots, 10 to 15 minutes, or broil 3 inches from heat, 2 to 3 minutes. Enjoy!
If making individual gratins, bake 20-30 minutes.
Also, for a shortcut, use 3 packages of creamed spinach(cooked) and skip the cream.
Some reviewers added a little jalapeno(or chipotle peppers and sliced almonds on top.