Ah, the sweet pinky stretch. Got one advice that helped me … Keep practicing . Sorry, but don’t know any quick fixes for that. It’s a matter flexibility and a little strength and that takes some time. And of course a good hand position helps, but you will feel strain in the beginning. For good hand position I once got the advice to keep your thumb with the second finger (middle) and that helps me a lot. I tend to leave the thumb behind when moving up the neck but that really makes it impossible to stretch. I still hear this advice regularly (guess college doesn’t result in good memory per se ) and every time it turns out to be true!
Another advice I got was to take a small part and repeat it endlessly, which I find boring but also terribly effective. So, having the same difficulty as you, I practice this specific lick actually daily with Ben’s tab for bugle call rag. In the middle (2nd break) he plays the same lick and it is a good exercise to loop the first 8 measures of that break, it has the same lick in the first half and a slightly more difficult variety of it in the second half of this. It is measure 27-34 in the PDF. Moreover it also requires stretching from the ring finger playing both this lick at 29/30 and 33/34 and a fret higher in the c&d-chord shapes at 27/28 and 31/32. The eight measures are thus a mini song making it fun and it is full of finger practice. Hang in there!