In this paper, a semi-simple and Maxwell extension of the (anti) de Sitter algebra is constructed. Then, a gauge-invariant model has been presented by gauging the Maxwell semi-simple extension of the (anti) de Sitter algebra. We firstly construct a Stelle-West-like model action for five-dimensional spacetime in which the effects of spontaneous symmetry breaking have been taken into account. In doing so, we get an extended version of Einstein's field equations. Next, we decompose the five-dimensional extended Lie algebra and establish a MacDowell-Mansouri-like action that contains the Einstein-Hilbert term, the cosmological term as well as new terms coming from Maxwell extension in four-dimensional spacetime where the torsion-free condition is assumed. Finally, we have shown that both models are equivalent for an appropriately chosen gauge condition.