Longest known checkmate is in 549 moves, revealed by Lomonosov Tablebases.
You can see the game here.
Plus, you don't need to say "endgame" explicitly. Longest checkmates come from endgame tablebases already. And it's not possible to build a middlegame tablebase practically, because of the exponential space complexity. Let's say there is a middlegame position which is in 12-men tablebase:
---------------------------------------------
5-Men | ~7GB
---------------------------------------------
6-Men | ~1200GB
---------------------------------------------
7-Men | ~140000GB
---------------------------------------------
8-Men | ~10000000GB Estimated
---------------------------------------------
12-Men | Do the math :-)
---------------------------------------------