Five minutes left? That is a lifetime if you have a good offense. So it would depend on more than the info provided. The upside is kicking instead of punting and hoping for a longer field of play for your opponent. What brought up this question?
The situation arose in last night’s game for our arch rival. They punted from the end zone without any trouble, but it’s one where I probably would have taken the safety.
Their offense was getting nothing done (they finished with negative 15 yards rushing). A blocked punt TD would have effectively ended the game.
If you give the points and take the free kick, then my team starts from further down the field. A FG ties the game (and in HS OT from the 10 yard line, scoring is easier) and a TD still wins it.
It seemed like the situation made for a safety.
As it worked out, it didn’t matter. But it could have gone badly for them (good for us).
The game ended 7-6.