So you just have the two keypads?
Based on that second image it looks like what the original installer did was instead of running a dedicated cable to each keypad location, they ran one cable that goes from the panel to one keypad to the next keypad.
The second image (the location you call the second keypad) is actually the first one in the wiring sequence. That is where the wire from the panel first goes. They have cut the feed cable and spliced on four wires for that keypad.
The wire then travels directly from the one in your second image to the keypad in your first image.
Ultimately, you should be able to wire up and reuse the wiring at the location in your second image. There are enough conductors there that you shouldn’t have to worry about voltage drop. You could use four conductors for each terminal. You would just need to figure out which of the two cables where it is cut and spliced is coming from the panel and which is going to the next keypad.
I don’t know about the location in the first image. It would have 37 feet plus the additional distance between it and the other keypad to contend with, and you would need to splice the wires all back together for one long continuous run. It may be possible, but it is really hard to say how much extra distance is on the cable there.