New to manual transmissions also....
Just in case..... take a look inside and examine the little dogs on the synchro where they engage 5th gear. Compare with the pics below (showing a new part vs. the same presenting extreme wear). 5th gear condition can be better checked after removing/ disassembly of mainshaft. (you already got the TM or...?)
Worn dogs and generalized wear combined are the most common cause for a transmission jumping out of gear!
Both referred parts in your's could be worn out to that point where the only cure is replacing them... (-> $$$) All other gears and parts could be in a similar condition even if they still are functioning "smoothly"....?
Hopefully not but it could be time to think about a whole replacement tranny.
Try to shoot some close-ups from what you find!
Good luck!
G.