There are countless two and three star hotels running 24 hour shuttle buses to/from EWR with less than a 15 minute ride.
Was at the SpringHill Suites this past Tuesday. Same property has a Hampton Inn and Fairfield Inn. HI Express is nearby. Piles more.
Looking right now booking the Fairfield for tonight, so last minute booking, is $180 and I’d guess even less if you don’t wait until the day of to book.
Probably worth it for a bed, shower and a coffee at 4:30 am before boarding the free bus to the airport.
Mike