Let $M$ and $N$ be two $n$ dimensional connected closed manifolds with $n \ge 3$, and let $S$ be a $(n-1)$ dimensional closed submanifold common to $M$ and $N$. Consider the connected sum of $M$ and $N$ along the submanifold $S$, denoted $M\#_{S} N$ (described in https://en.wikipedia.org/wiki/Connected_sum#Connected_sum_along_a_submanifold). Roughly speaking, this is obtained by deleting $S$ from both the manifolds and then gluing along the boundary. This generalizes the canonical idea of connected sum, denoted $M \#N$, in which $S$ is taken to be a singleton.

I want to calculate the fundamental group of $M\#_{S} N$. I know how to calculate $\pi_1(M\# N)$ using the Seifert–Van Kampen theorem. I believe the same idea can be applied to this general case of connecting along $S$ but I'm running into problems since $S$ is arbitrary. Is there a way I can see how $\pi_1(M\#_S N)$ looks like in general? 

I understand that it might depend on $S$. Just like $\pi_1(M\# N) = \pi_1(M) \ast \pi_1(N)$, can $\pi_1(M\#_S N)$ be described in a similar, simple way in terms of $\pi_1(M)$, $\pi_1(N)$, and $\pi_1(\partial S)$ only? Thanks in advance for your help.

**Edit**: two corrections made in light of the comments.