A brace from Jordan Robertson helped Torquay put their league troubles behind them and book an FA Cup third round meeting against Southampton.
Robertson, who hit the crossbar in the first half, raced on to a Lee Andrews throughball and lobbed Glyn Garner for his first after 52 minutes.
James Walker weaved through the Gulls defence to draw Leyton Orient level but Robertson slotted again on 81 minutes.
He was gifted extra time to pick a spot after Alton Thelwell pulled up injured.
Leyton Orient: Garner, Miller, Lockwood, Saah, Thelwell (Ibehre 82), Chambers, Corden, Easton, Demetriou (Keith 61), Alexander (Connor 72), Walker.
Subs Not Used: Morris, Barnard.
Goals: Walker 58.
Torquay: Abbey, Andrews, Reed, Villis, Woods, Angus (Critchell 50), Hill (Motteram 38), Mansell, Murray, Robertson, McPhee, Motteram (Thorpe 85).
Subs Not Used: Hockley, Ward.
Goals: Robertson 52, 81.
Att: 2,384
Ref: R Booth (Nottinghamshire).