Boil the squash for 10 minutes in a pot, then drain and dry using paper towels.
Put the boiled squash in the baking dish.
Melt 4 tablespoon of butter in a pan, then saute the onion over low heat until softened.
Put the sauteed onion on top of the boiled squash, then layer it with cheese, beaten egg, sugar, salt, mayonnaise, and butter crackers.
Preheat oven to 350 degrees F.
Bake the squash mixture for 30 minutes. After 30 minutes, remove the baking dish from the oven.
Serve hot and enjoy!