Magnetic and crystallographic transitions in the Cairo pentagonal magnet Bi2Fe4O9 are investigated by means of infrared synchrotron-based spectroscopy as a function of temperature (20 -300 K) and pressure (0 -15.5 GPa). One of the phonon modes is shown to exhibit an anomalous softening as a function of temperature in the antiferromagnetic phase below 240 K, highlighting spin-lattice coupling. Moreover, under applied pressure at 40 K, an even larger softening is observed through the pressure induced structural transition. Lattice dynamical calculations reveal that this mode is indeed very peculiar as it involves a minimal bending of the strongest superexchange path in the pentagonal planes, as well as a decrease of the distances between second neighbor irons. The latter confirms the hypothesis made by Friedrich et al., 1 about an increase in the oxygen coordination of irons being at the origin of the pressure-induced structural transition. As a consequence, one expects a new magnetic superexchange path that may alter the magnetic structure under pressure.