Lock the gate.

Literal

Gate [on-に] key [obj-を] apply-[command-なさい].

鍵をかける ('lock,' lit. 'apply a key') is the standard way to say 'lock.' Uses the productive pattern X に Y をかける for applying something to something. Without 鍵, just かける can mean 'hang, apply, spend.'