How do I know which version of Google Play Services to update to? I have an Android 5.1 system on a Doogee X5 phone, but this question is a bit more general.

Suppose I want to update my "Google Play Services" manually, without having a Google Account of any kind. This question tells me where to go to get the APK, but - how can I tell which APK I need? Wouldn't there be different APKs for different versions of Android, and possibly different vendors (who may provide modified Android versions)?
You could use OpenGApps.  I believe it is sanctioned by Google and allows you to easily select the latest version for your device architecture and Android version, customizing the package by which apps/services you want.

The Doogee X5 has a MTK6735 chip, which is 64-bit ARM.  So you should select the ARM64 platform version and 5.1 Android version, and then decide which app package you want from there.  Once downloaded, you can flash it via Recovery (recommended).

It is also possible to extract the apps for a manual upgrade.  I just tried it this way on OSX (should also work on Linux):


Extract your downloaded zip file (to, for example, ~/gapps)
Run the following commands:

cd ~/gapps/Core
lzip -d *.lz
find . -name *.tar | while read line; do tar -xvf $line; done

You'll now have some folders with the APK files.  The ones of interest to you are probably:

gmscore-arm64/nodpi/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk
gsfcore-all/nodpi/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk