Assuming your cylinder is oriented so that its local y+ axis (green arrow on the local transform gizmo) points along the length of the cylinder (like it does for the default Unity cylinder), then you're looking for a quaternion that rotates (0, 1, 0)
to lie parallel to (target.position - pivot.position)
.
(If that's not how your axes are set up for this object, be sure to edit your question so that critical details like this are made explicit)
Unity has a a couple of great convenience methods to do just this. You could try:
transform.rotation = Quaternion.FromToRotation(
Vector3.up,
target.position - pivot.position
);
or
Quaternion zToTarget = Quaternion.LookRotation(target.position - pivot.position);
Quaternion yToZ = Quaternion.Euler(90, 0, 0);
transform.rotation = zToTarget * yToZ;