It's easy to compute an inverse $\!\bmod n\,$ of a factor $\,a\,$ of $\,n\!-\!1,\,$ i.e. if $\,n\equiv 1\pmod{a},\,$ viz.
Easy Inverse: $\bmod n = ba\!+\!1\!:\,\, -ba \equiv -1 \,\Rightarrow\, a^{-1}\equiv -b.\,\ $ OP is $\,a,b = 5,2.$
Thus the inverse is computable by a $\rm\color{#c00}{single\ division}$ $\,a^{-1}\equiv -b\equiv (n\!-\!1)/a\,$ if $\,n\equiv 1\pmod{\!a}.\,$ Similarly we have $\bmod n = ab\!-\!1\!:\,\ ab\,\equiv\, 1\ \Rightarrow\ $ $\,a^{-1}\,\equiv\, b\,\equiv\, (n\!+\!1)/a$.
Generally we can use the Extended Euclidean Algorithm or Gauss's algorithm to compute modular inverses and fractions, e.g. see here and here. The above easy inverse formula is an optimization of the case when the algorithms terminate in a $\rm\color{#c00}{single\ step}$). The analogous double step optimization is inverse reciprocity. Both prove convenient in manual calculations.