That should work. You may want to add a capacitor on the output so that there is no significant voltage rise in the time it takes the MOSFET to turn off, if the input rises quickly.
Also, you could add a high value resistor between Vout and the base of the transistor. If the input voltage rises slowly, you don't want the MOSFET running in it's linear region as it will get hot. The suggested resistor will add hysteresis, which should stop that happening.
To test the circuit, supply it via a diode from its normal voltage. When you connect the higher voltage, do so after the diode. That way there will be no break in the supply when the higher voltage is applied.