Assuming you want final result in terms of the gi(s):
syms g1(s) g2(s) g3(s) g4(s) g5(s)
symsys1 = g4(s)-g5(s);
symsys2 = g2(s)/(1 + g3(s)*g2(s));
symsys4 = symsys2*symsys1;
symsys5 = symsys4*g1(s);
symsys6 = symsys5/(1 + symsys5);
symsys6 = simplify(symsys6,50);
[num,den] = numden(symsys6);
symsys6 = num/den;
symsys6
symsys6 =
(g1(s)*g2(s)*g4(s) - g1(s)*g2(s)*g5(s))/(g2(s)*g3(s) + g1(s)*g2(s)*g4(s) - g1(s)*g2(s)*g5(s) + 1)