You asked

How does a used pentax k 500 compare with a used panasonic lumix gx85 for low light?

Here is what the site says about that.

From Panasonic Lumix GX85: Panasonic Lumix GX85: A mirrorless camera by Panasonic with a 16-megapixel Micro Four Thirds sensor, announced in 2016. Sold as the GX80 in Europe. Small, stabilised and very cheap used. Specs - Maker: Panasonic - Mount: Micro Four Thirds - Sensor: Micro Four Thirds, 17.3 x 13mm, crop factor 2.0 - Resolution: 16 megapixels - Stabilisation: in the body - Announced: 2016 - Type: mirrorless camera Price in France - Used: 409–424 € ...

From Pentax K-500: Pentax K-500: A DSLR by Pentax with a 16.3-megapixel APS-C sensor, announced in 2013. The K-50 without weather sealing. Specs - Maker: Pentax - Mount: Pentax K - Sensor: APS-C, 23.5 x 15.6mm, crop factor 1.5 - Resolution: 16.3 megapixels - Stabilisation: in the body - Announced: 2013 - Type: DSLR Focal lengths on it Lenses frame like 1.5 times their focal length on full frame: 16mm like 24mm, 23mm like 35mm, ...

Quoted from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.