On realizing centralizers of certain elements in the fundamental group of a 3-manifold