Taking control of an aircraft from a pilot in command without their consent would normally be an offence under s. 7.3(1) and 7.41 of the Aeronautics Act (but I'm doubtful that the act of the passenger in your scenario is "endangering the safety" of the aircraft) and possibly s. 76 of the Criminal Code (I'm also doubtful that the mens rea is met in the specific scenario you describe).
Regardless, in your scenario, the act would most likely be justified by the defence of necessity. "[T]he situation must be so emergent and the peril must be so pressing that normal human instincts cry out for action and make a counsel of patience unreasonable." There must also be "no reasonable legal alternative" to avoid the imminent peril. See generally, Perka v. The Queen, [1984] 2 S.C.R. 232.