The Gell-Mann Nishijima formula states that $$Q = I_3 + \frac{Y}{2}$$ where $Q$ is the electric charge, $I_3$ is the third component of isospin, and $Y$ is the hypercharge. This was an empirical fact noted back in the 50's, well before anything like quantum chromodynamics or the Standard Model was constructed.
Much later, the Standard Model was constructed with gauge group $SU(3) \times SU(2) \times U(1)$, where the $SU(2)$ piece is called 'weak isospin' and the $U(1)$ piece is called 'weak hypercharge'. It turns out that after spontaneous symmetry breaking, $$Q = T_3 + \frac{Y'}{2}$$ where $Q$ is the electric charge, $T_3$ is the third component of weak isospin, and $Y'$ is the weak hypercharge. However, $T_3$ and $Y'$ have nothing to do with $I_3$ and $Y$. For one thing, they deal with the electroweak force while the latter deal with the strong force.
The formulas look extremely similar (they're so similar that people mix them up, like in the second answer here), but I'm having trouble seeing if they're true for 'the same reason'. The second formula follows from the pattern of spontaneous symmetry breaking, while as far as I can tell the first formula is true for no good reason at all; you basically have to get some kind of relation like that because matter is made of quarks in two-quark generations (i.e. three variables, two equations).
Is there something deeper underlying the similarity between these formulas? Is it just a coincidence? Is it a historical artifact, where $T_3$ and $Y'$ were 'reverse engineered' so the formula looks just like the Gell-Mann Nishijima formula?