Coding lookAt with extra rotation

I would like to program a camera to look at an entity, but have the rotation along the Z-Axis twist with the entity.

Has anyone done this before?

As in, you want the local Z rotation of the camera to match the Z rotation of the entity?

Yes, that is what I was referring to. At this point I have solved it by placing the camera in a wrapper with the car. It works but I would love to know how to do it with code.