The other answers are great demonstrations of F9's capabilities, but I'll be the contrarian here and say they're all wrong and perhaps Elon oversimplified things for a tweet.
This was a one engine landing burn. A single engine lacks the ability to control roll on its own, unless it has a vectoring turbopump exhaust. Merlin 1C had this feature for roll control on Falcon 1, but Merlin 1Ds on Falcon 9 have fixed turbopump exhausts.
Only one 'engine' aboard the booster had the ability to control roll, the nitrogen cold gas thrusters. One can be seen trying to counter the roll several times during the landing attempt, such as here:

The uncontrolled roll was induced by grid fin failure. The landing burn slowed the vehicle, reducing air flow through the fins and lowering the unwanted control input. Eventually it slowed enough that the cold gas reaction control thruster could dampen much of the spin. More rotation was shed when the legs deployed, changing the moment of inertia (the classic dancer putting her arms out to slow). Note that it was still spinning some all the way up to splashdown, so the roll was not stopped, merely reduced.
I think Elon was going for brevity on Twitter. The main Merlin engine helped regain control of the vehicle, but it didn't directly kill the spin. The cold gas thrusters (a type of 'engine') did much of the work after the landing burn made the fins less effective.
Prefer it in video form? Scott Manley walks through the descent videos, making much the same points I did here: