Hotels around the airport are the best option. But even you are staying for a few hours is going to cost for a day.
The hotels around the airport do hv day rooms available but they are based on occupancy. You'll hv to contact the hotels directly to find out the fees and if anything is available on the day you need it. The only other option that I can think of would be an air bnb if you are familiar/use them and are comfortable with that type of accommodation. Good luck!
I would start with the ewr website. If direct information is not there you could call the airport.
Thanks! Your answer is awaiting moderation.