Depending on the generation of your Play 5 you may have a line-out (gen 1) that you can connect to a line-in on the Bose.
Either generation will have a line-in that you can add a selector switch ahead of to allow choosing fro two inputs.
Don't know much about Bose but the Sonos only has the one or two connectors available.
You might also add info about the Bose Dock such as model number. Don’t assume that everyone knows what a Bose Dock is designed to do. My experience with Bose dating back a few years is that their products can be proprietary in some cases. I presently don’t have any Bose products.