Assuming you're working on a FZJ80?
Make sure of course that the groove for the gasket is completely clean, no left over bits of the old gasket stuck in there. Adding a small dab of FIPG in the groove at the corners before installing the gasket won't hurt, don't use too much, you don't want it to get squeezed out and break off then fall inside. Just let it set up a bit before attempting to install the valve cover. But IME if the gasket is pushed all the way into the groove it should stay there as long as it doesn't get bumped as you're installing the valve cover.
FWIW I've used thick silicone grease (dielectric grease, not an aerosol silicone) slathered on the gasket before I push it into the groove. It's sticky and will help hold the gasket in place.
@Gergg : are you also replacing the spark plug tube seals? The PCV valve grommet? Did you clean out the oil baffle box (inside top of the valve cover) while the valve cover was off? IME it takes a lot of cleaning to remove 25 years of burned oil/varnish/sludge from inside that area.
If you're working on a FZJ80 here are some other maintenance items while the valve cover was off:
Replace spark plugs
Replace spark plug wires if original (they last about forever if not damaged)
Replace Distributor cap and rotor
Clean distributor under the cap (Warning;
do not use brake/carb cleaner, Electronics cleaner only).
Replace distributor O-ring (common oil leak but have to pull the distributor.
Clean Throttle body (internally) including the three small vacuum ports?
Clean IAC valve port (you'll need new a IAC valve O-ring)
Check main engine harness near the EGR pipe, add heat insulation sleeve??
Replace Heat Control Valve?
Replace old hardened vacuum lines?
Replace PCV and breather hoses?
Check/replace air intake hose?
Clean MAF sensor with correct MAF cleaner?
Clean air filter can, replace filter?