If your garage door includes a contact sensor, you could do this with Rule Machine.
Conditions would be garage-lights off, garage-door open. Rule would be garage-lights off AND garage-door open, and the actions for true would be turn on the lights and turn-off after delay of 5 minutes.
So, if the lights are off, and the door opens, the lights would come on and then turn off 5 minutes later. But, if the lights are on when the door opens, the rule fails, and it doesn’t turn the lights off after 5 minutes.