Thanks everyone. This will be all on one ticket. Thanks for the suggestion on LAX versus SFO. I wasn't thinking of the potential weather delays.
Both of these are red eye flights. Both of them get in around 5am and then the flight to EWR is an hour later at 6am.