In MathOverflow, the following theorem is claimed: "Theorem 1. Let A be a rng (= nonunital associative ring). Let J be a (two-sided) ideal of A. Assume that both rngs J and A/J are unital. Then, the rng A is also unital.", see https://mathoverflow.net/questions/487676 (/unitality-of-rngs-is-inherited-by-extensions).
This thread also contains some hints to literature: Clifford and Preston's book "The Algebraic Theory of Semigroups"(Chapter 5 on representation theory), and Okninski's book Semigroup Algebras, Corollary 8 in Chapter 4.
In the following, this theorem is proven formally, see rngringbdlem2 (and variants rngringbd and ring2idlqusb).
This theorem is not trivial, since it is possible for a subset of a ring, especially a subring of a non-unital ring or (left/two-sided) ideal, to be a unital ring with a different ring unity. See also the comment for df-subrg. In the given case, however, the ring unity of the larger ring can be determined by the ring unity of the two-sided ideal and a representative of the ring unity of the corresponding quotient, see ring2idlqus1. An example for such a construction is given in pzriprng1ALT, for the case mentioned in the comment for df-subrg.