Preheat oven to 350°F (175°C). Grease a casserole dish with butter.
Cook squash & onions together until tender, then drain excess water.
Mix filling: In a large bowl, combine squash, onions, cheese, mayonnaise, egg, salt, and pepper. Stir gently.
Layer the mixture evenly in the casserole dish.
Prepare topping: Mix crushed crackers with melted butter, then sprinkle over the casserole.
Now bake for at leat 25–30 minutes until you get the golden brownish bubbly texture.
Cool slightly before serving for best texture.