How should I connect a new dimmer switch?
You are going to need to identify the hot and the switched hot. It looked like the hot goes to black and the switched hot goes to the brown. Connect white to whites and ground to ground as you thought.