We've sneaked over to MK on travel days when we've been in Florida; we're AP holders at Disneyland, so five hours feels generous.
Since you may be less familiar with the park, though, I would say that making a plan
with time in mind is one of the most important things.
- tempting as it may be, don't park hop: Disneyland and California Adventure are close, but that's still a lot of walking -- consider time to cross the esplanade, time to get through the gates at the parks, time to walk to whatever ride you're headed for;
- cluster your rides, whenever possible -- if you're doing Pirates, do Indy; if Toy Story, the Incredicoaster;
- go on Guardians of the Galaxy: Mission Breakout! -- right now, it's my favorite ride in either park, and still unique to any Disney park in the world;
- use Max Pass! you can't use it on every ride (such as Pirates) but, if you use it for other things, that gives you more time for lines, if needed;
- if you can, choose not to sit down to eat! there are plenty of kiosk-type options: if riding Pirates/Mansion, grab a bread bowl clam chowder at Royal Street Veranda (look right immediately before you enter the inside Pirates queue); if Main Street, grab a corndog (MK corndogs don't even come close), and there are also corndogs in DCA, near the Ariel ride;
- consider a grand circle tour on the Disneyland Railroad: it's 20 minutes, start to finish, and a great chance to rest your feet
So many other things you can do, but that's what I've got for now. Five hours can be plenty of time if you do some planning ahead of time. (^_^)