Discharge peak hold capacitor with MOSFET
simulate this circuit &ndash; Schematic created using CircuitLab
With the limited information of the question, this is the circuit information I can provide. The ratings for the resistor and mosfet will depend on your voltage and how fast you want to discharge the capacitor.
The schematic that you drew will more than likely not work. You can't use a N-Channel as a high side switch the way you're doing it. You could use a P-Channel, but this is my personal preference of the way to do it.