Yes. Works great. The late 2012 runs a full 2.5" drive so you're going to want a mount adapter for the drive as it is laptop size.
Don't know if you've ever taken your iMac apart but you're going to want to be crazy careful with that too. The screen is held on with dougle-sided tape (yeah, I know), so you're going to want to grab a roll of Scotch, black, heavy weight (30lbs) tape so you can get your monitor back on. Best thing to do is cut it unto thin strips with an exacto-knife, on parchment paper and on a cut friendly surface. Cut the strips about an 8th of an inch. You're also going to want to make absolutely certain you get ALL the old take off the back of the monitor AND inside the case. Can't stress that enough. The new take will NOT hold if you don't. If this sounds like too much just let Apple do it.
They didn't design the iMac to be end-user serviceable. You can do it but it ain't fun. :-)
Good luck!