Preheat oven to 350°F and grease a 9x13-inch baking dish.
Boil sweet potatoes in a large pot until fork-tender, about 15 minutes, then drain and mash until smooth.
Mix mashed sweet potatoes with granulated sugar, 1/4 cup melted butter, beaten eggs, milk, vanilla, cinnamon, and nutmeg until well combined and creamy.
Spread sweet potato mixture evenly into the prepared baking dish.
In a separate bowl, combine brown sugar, flour, 1/3 cup melted butter, and chopped pecans until crumbly.
Sprinkle the pecan topping evenly over the sweet potato mixture.
Bake for 25-30 minutes until the topping is golden brown and the casserole is heated through.
Let cool for 5 minutes before serving.