The most simple answer is to try a slight adjustment to your rear derailleur cable adjustment. You did not mention that you attempted this in your question, so I will offer it here.
You could try to slightly adjust the shift cable at the rear derailleur by turning the adjusting barrel clockwise. Try 1/8, 1/4, and even up to maybe 1/2 of a turn. This will effectively lengthen the shift cable slightly which might get the shift from the larger gear into the 5th gear to work properly. When doing this, you will need to pay attention to the shifting behavior of all the other gears, in both directions (going up and going down) as the adjustment you make may make those other shifts worse. So pay attention to where you start your adjustment from so that you can always return to where you started from in case the adjustment does more harm than good (i.e., you have turned the barrel adjuster 1/2 turn clockwise, then just turn it 1/2 turn counter-clockwise to return to the original adjustment setting).
There usually is a little wiggle room in adjusting a rear derailleur cable to allow for this and get the shifting to work well in every gear. However, there are a few cases where there is no adjustment that works perfectly for every gear. I have experienced this myself, and it came down to accepting the tradeoff. In my situation I had to slightly over-shift going from a smaller cog to one particular larger cog, which I found I could tolerate.
One more thing to consider: If your rear derailleur has a clutch on it (more popular with gravel, cyclocross, and MTB setups - and your bike is cyclocross), the clutch behavior can sometimes hinder the shifting a bit. If you do have a clutch, you might try to see if flipping the clutch lever on the rear derailleur to turn off the clutch behavior affects the shifting.
If your RD is a SRAM APEX 1, here is a product page. This RD has a clutch.
SRAM APEX 1 Link