Those are not viable codes there should be 4 digits after the P.
P5131 does not exist in my chart, the closest is for both upstream O2 sensors, I think I would spend the money and get the system live scanned just make sure your not chasing a grounding problem or a low or spike voltage.
Looking for a Used Grand Marquis in your area?
CarGurus has 4 nationwide Grand Marquis listings and the tools to find you a great deal.
Search Mercury Grand Marquis Questions
Mercury Grand Marquis Experts
Related Models For Sale