LR 5.7.1 should run with 10.12. With 10.9.5 you would be able to update to 6.6.1 only.
You can download from here: Download Photoshop Lightroom
LR6 will copy your current LR5 catalog and then upgrade the copy.
... and as always before upgrading OS and applications ... backup everything, specially the catalog since this is where your work is.
Some related reading: https://www.lightroomqueen.com/how-move-lightroom-to-new-computer/
Thanks. From your answer it seems that the order won't matter. I'm planning to do the OS first. I can then check that the library is OK under 10.12.x and LR 5.7, and then upgrade to LR 6. My LR says it's 5.7 everywhere I look--not 5.7.1--and Check for Updates says that it's up to date...
Sounds like a plan