If you're planning to be there at 5 (which is when they open, I believe) to check in for dinner, you should make it back just in time.
If you're seated by 5:15, and spend an hour eating, then walk over to the Swan/Dolphin boat dock to catch the boat back (or walk all the way back to DHS), you should be able to get through the gates at DHS a few minutes before 7. You'll have to make a beeline straight to the Fantasmic entrance, though; I think you're supposed to arrive 30 minutes before showtime to use your pass.
I wouldn't
(a) catch the boat back at the Yacht Club dock - because it will then head to the Boardwalk and then to the Swan/Dolphin before going on toward DHS
(b) arrive to check in at Cape May later than 5
Personally, if I was trying to do it, I'd plan on a $10 cab ride back after dinner to make sure I arrived with enough time to get to use the Fantasmic passes, if their use was my ultimate goal.
Although.... I personally would not book Cape May (buffet) on an evening where I already had a large/heavy lunch planned... but that's just my preference.