It helps that it was a centre engine I imagine, correct me if I am wrong, so there was no loss of symmetry of thrust. An outer engine failure would have created some massive torque.
As long as the remaining engines can generate net thrust through the center of gravity, there's no problem. That means having gimbals that go far enough. This would increase the angle of attack, and that might be a problem during atmospheric flight but not in vacuum.
As I recall, at least some of the Saturn V launches canted the four outer F-1 engines outward slightly after tower clear to improve the IU's ability to compensate were one of the engines to fail. Since liftoff acceleration was barely greater than 1 g I don't think the Saturn could tolerate an engine failure immediately after liftoff, but if it happened later when acceleration had increased and less burn time would be lost on the failed engine, it might well have been able to compensate. I don't know what the angle of attack would be, this is absolutely critical in the max-Q region but you get out of that as quickly as you enter.
Edit to add: Remember the IU deliberately shut down the inboard engine before the four outboard engines. I'm sure the IU was programmed so that if an engine had already failed, the IU would not shut down another one, and this would probably compensate for much of the lost performance. Maybe even completely compensate if the engine failure happens late enough.