Whether a piece of meat is near its shelf life or not, does it also determine how long it can be stored after it is cooked?
Food safety rules are simplified to the point where you apply them without any further considerations, edge cases, additional calculations, or anything else. You just do what it says. 

So, when the rule is that cooked meat holds 3-5 days in the fridge, then this always holds for meat which was safe when it was cooked. It doesn't matter if it was cut fresh from the cow or on its last day of safety. The date on the package is calculated such that it will still hold for 3-5 days if cooked on the last day.