Heat oven to 350°F.
Melt butter in a saucepan over medium heat, then whisk in flour. Continue stirring and cook for 3 minutes.
Whisk in the milk and wine thoroughly until smooth.
Add the diced onion and cayenne, then bring mixture to a simmer.
Add salt and simmer until thickened, stirring and scraping the bottom frequently, about 5 minutes.
Remove sauce from heat and stir in 4 1/2 oz of the grated cheese until melted. Set aside.
Bring water to boil for pasta and cook for about 7 minutes until firm but just hydrated in the center.
Drain pasta and stir into the cheese sauce.
Transfer mixture to the saucepan or a ceramic/enameled baking dish and sprinkle remaining 1 oz cheese over top.
Bake for 25-35 minutes until cheese is golden brown.
If extra browning is needed, place under broiler for 1-2 minutes, watching carefully.
Let cool 3-5 minutes before serving.