You can get your things back before sneaking out or after the battle. Here is what I did.
I looted all the chest in the lower camp before going to Erik. There are at least two dyed brigandines. Then I went to talk to Erik, behind him is a chest loot it. You won’t get a chance after being captured. There is a ravens beak and some other loot.
Go to the trainer, but before talking to Erik go to the building next to the house. If your standing in front of Erik’s house it’s on the left. Go in and you will see a chest store some lock picks or all your gear in it. Go and talk to Erick.
After being captured before you leave go to the chest and get your things. If you put just lock picks in it get them. Lock pick the door watching out for the guard. There is a key on Erik’s desk. It’s next to the keg. Get your stuff from the chest in front of the desk. You will notice the chest behind Erik is gone.
I put my stuff in the chest in the building next door. However I looked into the chest inside Erik’s house anyway. There were two keys of mine inside