Here's my attempt at constructing a position where underpromoting the 2nd rank pawn is the only way to self-mate in 5:
As you can see, I've split the problem into 3 parts: a prison for the white king, a prison for the black king, and a prison for the black rook.
The only way to force the black knight to move is to stop the black king from moving around in ...
Consider the following solution:
The moves proceed as follows (with all moves forced for black):
The notation in the last line just indicates that white can promote to either a knight, bishop, or rook.
The reasoning is as follows: