This is probably an oil sending unit that is going bad. I have it happen to me quite a bit in my Mustang. Not sure why they go out, but they do. Check to make sure wire is on good and tight. If it is I would pick one up at local parts house. They are inexpensive, around $10.00. I have included removal/installation instructions in the diagrams below.
Images (Click to enlarge)
Sunday, February 17th, 2019 AT 10:22 PM