Think about how Door's lock. Theres one side of a post that has a curved side which allows the shaft to slide it backwards via a spring. Once its in place, the other side - which is squared, does not allow reverse travel.
You can make a simular system where there are 4 metal posts that come out from the bottom of your removable top panel, and stick down about 4". Each of the posts will have to be grinded so that there is a groove near the ends to which a mechanism can lock into.
On your main panel.. you drill 4 holes (or heck, 2 post should be fine i think),
and make a spring loaded bar on each side. One side of the bar will have the
curved face to allow travel, and the other side flat to lock into the poles grooves.
You probably could use house Trim molding (the decorative wood trim that sits on the edges of ceilings or floors) for the locking bar.
Instead on metal posts, you could use wooden dowels too.
To unlock the system, you would need a release wire setup. Where you pull the
main lockbar backwards with a wire that is attached to it. The release could be a button, or use a pull-cord that dangles out one side of the panel.