Gluing two 3 manifolds along their boundary Let $X,Y$ be two compact, smooth, orientable 3 manifolds, each with an incompressible  boundary component diffeomorphic to some genus $g $ surface $S_g$. Under an orientation-reversig diffeomorphism $f:S_g \to S_g$, those two manifolds can be glued together to obtain a new smooth, orientable manifold $X \cup_f Y$. I wonder now in how far the diffeomorphism type of this result depends on the choice of $f $. Using a collar, one can show that if $f $ and $g $ are two isotopic diffeomorphisms of $S_g $, then the corresponding gluings are diffeomorphic . Is this also a necessary condition ? 
Some thoughts I have made so far: 
1) If both X and Y are irreducible, then so is $X \cup_f Y$, and if $X \cup_f Y $ still has some boundary component, it must be an aspherical manifold. Hence, all important Information is contained in the fundamental group. Is it true that the homeomorphism type of aspherical 3 - manifolds obtained this way is already determined by their fundamental group ?
2) Also, I wonder if its true that the isotopy type of two orientation-reversing diffeomorphisms on a surface $S_g$ is determined by their action on the fundamental group. 
Edit: This is probably false, since mapping class groups of surfaces are very distinct from the corresponding fundamental group.
Any help is appreciated. 
Edit: I apologize for missing and/or inaccurately placed capital letters. I wrote this question yesterday evening on my phone, and it was impossible to fix all the mistakes made by auto-correct (I am writing on a german phone).
Edit 2: I have also updated this question, according to what has already been solved by the answers and what is still open.
 A: Ad (2): the mapping class group of surfaces is isomorphic to the outer automorphism group of its fundamental group - this is a theorem of Baer-Dehn-Nielsen. In particular there is even a finite set of closed loops such that an element of the mapping class group is determined by its action on this set. 
Ad (1): irreducible, orientable 3-manifolds (with the exception of $S^2\times S^1$) have $\pi_2=0$ and - assuming $\mid \pi_1\mid=\infty$ - it is an exercise in algebraic topology to prove that they are then aspherical. It is then a classical fact that the homotopy type is determined by $\pi_1$. From the answer to 3-manifolds with isomorphic fundamental groups one sees that even the homeomorphism type is determined.
Ad the original question, whether the gluing map $f$ is determined up to isotopy by the homeomorphism type of $X\cup_fY$, I do not know. (I think I remember there are $3$-manifolds with non-equivalent fiberings, although I don't know a reference. In any case, this only yields examples with disconnected boundary.)
A: The original question: 

Using a collar, one can show that if $f$ and $g$ are two isotopic diffeomorphisms of $S_g$, then the corresponding gluings are diffeomorphic. Is this also a necessary condition? 

No, it is not.  Suppose we have glued to obtain $M = X \cup_f Y$.  Suppose that $X$ admits a self-homeomorphism $\Phi$.  Define $\phi = \Phi|\partial X$.  Then the map $g = \phi \circ f$ gives the manifold $N = X \cup_g Y$ and this is homeomorphic to $M$.  
Now, it is simple to find such $\Phi$ if $X$ has compressible boundary - namely we can do a Dehn twist on a disk. You've ruled that out.  But we can still find examples by twisting along an essential properly embedded annulus in $X$.  For example, if $X$ is a twisted $I$-bundle over a non-orientable surface.  
If you further assume that $X$ is "acylindrical" then there are still examples, but they are harder to find.  We can build a hyperbolic manifold $X$ which has a self-homeomorphism $\Phi$ of finite order (eg Thurston's knotted Y).
If you further assume that $X$ (and $Y$) has no symmetries, then examples should still exist, but they will be very hard to find.  Basically, we need to find a manifold $M$ that contains homeomorphic surfaces $S$ and $S'$, but where there is no homeomorphism of $M$ taking $S$ to $S'$.  We then need to "get lucky" and find that $M - n(S)$ and $M - n(S')$ are homeomorphic and win.  One way to do this is by a search through one of the many censuses of closed three-manifolds (eg snappy or regina).  Another way that should work is to think deeply about hyperbolic three-manifolds with "corners".
