Can i still use my spare tire for a long time even though it was not use for almost 4 years and was just stock at the back of the car. My spare tire is just the same as the one that was installed.
If your spare is a full size tire then there's no reason you can't use it longer term as long as it's in good shape. Over time the rubber compounds will break down and you'll get sidewall cracks which weaken the tire to the point it isn't safe. If it's 4 years old it should be fine.
You have to keep in mind that you won't have a spare though, if you get a flat you're going to be stuck.
If the tire is a limited service one it is definitely not okay to use long term.