Unfortunately, spacedesk iOS viewer only support iOS version 9.3 and above.
In your case, you can only use spacedesk HTML5 viewer using your iOS v5.1 device.
Just open a web browser (e.g. Safari or Google Chrome) then go to http://viewer.spacedesk.net/ and connect to the IP address of your primary machine.
Keep in mind that this HTML5 VIEWER is much slower than our native apps on Android, iOS and Windows.