lam = Sqrt[s(s-4*msq)]

ibpRules={
I12->-(2-d)/(2 m^2 (s-4 m^2)) I01+(d-3)/(4 m^2-s) I11,
I21->(2-d)/(2 m^2 (4 m^2-s)) I01+(d-3)/(4 m^2-s) I11,I22->-((d-2) (-6 m^2+2 d m^2-s))/(m^2 (4 m^2-s)^2 s) I01+((d-3) (4 m^2-6 s+d s))/(s (s-4 m^2)^2) I11,
I20->(d-2)/(2 m^2) I01} /. m^2->msq /. 1/m^2->1/msq;

ibpRules

ToPreCanonical = Solve[ibpRules[[{2,4}]] /. Rule->Equal,{I01,I11}][[1]]

ToCanonical = Solve[{g1==eps*I20,
g2==eps*lam*I21},{I21,I20}][[1]]

(*D[eps*lam*I21[s],s] /. D[I21[s],s]->-1/2/s*( s*I22 - I12 + I21 ) /. I21[s]->I21 /. ibpRules /. ToPreCanonical;
Collect[% ,{I21,I20},FullSimplify] /. ToCanonical*)

(* dg2/ds in terms of I01 and I11 *)
DEv1 = Collect[D[eps*lam*I21[s],s] /. D[I21[s],s]->-1/2/s*( s*I22 - I12 + I21 ) /. I21[s]->I21 /. ibpRules (*/. d->4-2*eps*),{I01,I11},FullSimplify]

ToCanonical2= ToPreCanonical /. ToCanonical (*/. d->4-2*eps*)/. Rule[a_,b_]:>Rule[a,Collect[b,{g1,g2},Factor]]

(* dg2/ds written in terms of canonical basis g1 and g2 *)
DEv2 = Collect[DEv1 /. ToCanonical2,{g1,g2},FullSimplify]

assumptions=msq>0&&0<y<1&&Element[{msq,y},Reals];

(* dg2/ds in terms of y variable *)
DEv3 = Collect[FullSimplify[DEv2/. s->-msq (1-y)^2/y/. d->4-2 eps,Assumptions->assumptions],{g1,g2},Factor]

(* dg2/dy *)
DEv4 = Collect[D[s /. s->-msq (1-y)^2/y,y]*DEv3,{g1,g2},Apart[Factor[#]]&]