Preheat the oven to 425 degrees F (220 degrees C).
Put butternut squash in the microwave and cook on high, until soft, 2 to 3 minutes. Cut in half, scoop out seeds and cube. Bring a large pot of water to a boil. Add squash and cook until tender, about 15 minutes. Drain and mash.
Combine 3 cups mashed butternut squash, white sugar, milk, vanilla extract, salt, flour, eggs and 1/4 cup melted butter in a 9x13-inch casserole dish.
Bake in preheated oven until set, about 45 minutes.
Combine crushed vanilla wafers, 1/2 cup melted butter, and brown sugar in a medium bowl; crumble over top of cooked casserole and return to oven to brown.