If you leave LL at 5pm, you will be driving into a disaster of traffic. It will also take some time to leave LL and get onto the freeway. If you go and eat, and leave at 7pm it will be cleared up. Leaving at 5pm it will take 90-120 minutes. Leaving at 7pm about 65 minutes since you will be beding the traffic.
The problem is the ticket booths may close not long after 8pm with the early closing on Monday a slow day for crowds at DLR. When it's busier you can usually find one open until about an hour after park closing, because Main Street is still open and busy that long.
What I would do, is at least take my time leaving LL. I have gone and saved Miniland for the end after the rides close. That lets me see it with less crowds and I didn't miss time during the day for the rides. There is some fast food and chains nearby and of course a lot just off the freeway as you go north.
In Anaheim you can exit on onto Harbor, not the
Disneyland exit from the carpool lane, to the far right after it that. Take Harbor south, go past the stop light where the crosswalk into DLR is. Just past that light is a entrence into the drop off area, you can park there for 15 minutes, or let someone wait in the car. That drop off may be busy.