If you’ve never owned/worked on a 5 you may not know it’s quirks regards to setup so try working through this list:
Check the pivot bearing aren’t shot, my 5 pulls one side under pedalling when one dies or needs regreasing.
Also check the swingarm bolts haven’t elongated allowing the arm to move on the bearing, this gives the same feeling.
Finally check the swingarm is aligned with the frame, it’s easy to have the rear wheel ‘crabbing’ after a bearing replacement or removing the shock. You should ideally have the rear shock mount drop into the swingarm mount without putting any sideload into the shock and the centre of the rear wheel should line up with the centre of the seatpost, easiest to check with the tyre off (presuming the rear wheel is dished correctly, switch it backwards to test).
Unlike a lot of bikes with complicated linkages etc it can all be adjusted by loosening the pivot clamps and ‘tapping’ the swingarm with a rubber mallet 😆
EDIT: just to add if the swingarm is misaligned or bent then it has the effect of putting your weight off-centre when riding straight so causing the bike to turn one way or the other.