I looked thru the Disk Utility User Guide and I guess my big problem is how do you know which is the first and last partition? For example, to enlarge a volume you must delete the volume that comes after it but you can't enlarge the last volume. [Volume, in this case, seems to mean partition, not volume in a container.] How is that defined? There is a tiny little partition at the top. Call that the first partition? Do we go clockwise or anti-clockwise from there? My guess is clockwise but I'm not sure.
Here's where it gets tricky. I don't want to try this until I've backed up the drive, but I can split the large partition into two pieces and the new piece falls between the Time Machine partition and the occupied part of the split partition. So far so good. Now, if I want to enlarge the Time Machine partition I need to delete the partition I just added and adjust the size of the Time Machine partition to fill that space. If it is "the last" partition I won't be able to do that. If it isn't I may. However, if I delete that partition wouldn't one of the other partitions automatically fill that space? I can wait until I have more drives to play with but maybe somebody knows.
My experience is that the round graph goes clockwise. In you image, TM is the last partition.
"Volume" is a term used in APFS. In any partition is a "Container" which holds "Volumes" that share that Container space. In that scenario, one can still partition the drive at the hardware level, which is what you are trying to do, and create multiple "drives" within that total hardware space. However, unlike Volumes, those partitions are fixed and can only be changed by direct manipulation. And that direct manipulation usually ends up in erasing the entire partition impacted as the directory area for that volume gets overwritten.
Here's where it gets tricky. I don't want to try this until I've backed up the drive, but I can split the large partition into two pieces and the new piece falls between the Time Machine partition and the occupied part of the split partition. So far so good. Now, if I want to enlarge the Time Machine partition I need to delete the partition I just added and adjust the size of the Time Machine partition to fill that space
Well, you've already accomplished the first step in that you have a drive with one large partition labelled "MBP M-1 - TM,...rack Data - TM" and one labelled "Untitled" and one labelled "TM...ne - TM." If the middle one, named "Untitled" actually exists as a partition, as it appears to do, then the drive has zero space into which the TM partition can expand. However, I don't know if you can just delete "Untitled" and then expand "TM...ne - TM" backwards into it and preserve the contents of "TM...ne - TM" at the same time. Doing that expansion that way adds more space in front of the partition, which disrupts the directory storage. That results in, if it can be done at all, an empty new partition.
Frankly, to move forward on this, I think you need to consider the actual value of the TM space at this point. How likely is it that you will actually need to go back in time to recover a file from last week, last month, last year? If you assess that to be very unlikely then the easiest path is to just start over, either with a new, smaller backup drive and repartition this older drive as a single full device. APFS is not very efficient, to say the least, on rotating drives as it creates a hugely fragmented drive that can be very slow, so it would be better to move away from APFS on that HDD.
So, if you decide that you don't need backups that far back, the best path forward, IMHO, is to get a 1 or 2TB SSD for TM, start backups on it again and leave the current HDD just as it is for now. Once you have sufficient historical backups on the new SSD to feel comfortable, erase and reformat the 5TB HDD in HFS+ (MacOS Extended, Journaled), which is much better on rotating drives. The size of the SSD needs only to be about twice what is currently in use on the source drive(s), not necessarily twice the drive capacity.
As an aside, I don't like huge drives that are then partitioned into multiple partitions and then each separately mounted. Too big a risk for me because any flaw in the partition tables and I could lose the entire drive, all partitions, all data. Too many eggs in one basket for me. It has happened to me in the past and now I avoid it with smaller drives, each a single partition and each with a dedicated use. I do have larger systems in RAID arrays and NAS storage where I keep backups and alternate copies of critical stuff. TM gets its own device.