The following methods are not proper and pose security, legal, and stability risks:
If you are a professional studio requiring exactly 10.5.1 (perhaps for plugin compatibility or session recall) and the App Store is forcing an update, the only reliable way to get that exact build is to restore it from a Time Machine backup or a cloned drive made when 10.5.1 was the active version.
Because Apple manages Logic Pro through the Mac App Store, downloading a specific older version (other than the latest one) requires a specific set of steps.