Using data of the ASPERA-3 instrument on board the European Mars Express spacecraft we investigate the effect of the martian crustal fields on electrons intruding from the magnetosheath. For the crustal field strength we use published data obtained by the Mars Global Surveyor MAG/ER instrument for a fixed altitude of 400 km. We use statistics on 13 months of 80-100 eV electron observations to show that the electron intrusion altitude determined by a probability measure is approximately linearly dependent on the total field strength at 400 km altitude. We show that on the dayside the mean electron intrusion altitude describes the location of the Magnetic Pile-Up Boundary (MPB) such that we can quantify the effect of the crustal fields on the MPB. On the nightside we quantify the shielding of precipitating electrons by the crustal fields.