Let $X$ be a set and $R\subset X\times X$. Let $$\mathcal{G}:=\{G\subset X\times X\ |\ R\subset G\ \land\ G=G^{-1}\ \land\ G=G\circ G\ \land\ pr_1(G)=X\}.$$ Then $\bigcap_{G\in\mathcal{G}}G\in\mathcal{G}$ and $\bigcap_{G\in\mathcal{G}}G\subset A$, for $A\in\mathcal{G}$. Write $\sim:=\bigcap_{G\in\mathcal{G}}G$ and let $\pi:X\rightarrow X/\!\sim$ be the canonical surjection.
For every mapping $f:X\rightarrow Y$, if $\pi(x)=\pi(y)$ implies $f(x)=f(y)$, for every $x,y\in X$, then there exists a unique mapping $\bar{f}:X/\!\sim\,\rightarrow Y$ such $f=\bar{f}\circ\pi$.
Now, let $\mathcal{D}$ be a small category and $F:\mathcal{D}\rightarrow\textbf{Set}$ be a functor. The coproduct ($\coprod F(D)$,$(c_D)_{D\in\mathcal{D}}$) of the family $(F(D))_{D\in\mathcal{D}}$ of objects of $\textbf{Set}$ exists. Substitute $\coprod F(D)$ for $X$ in the above description and let $$R:=\left\{((x,D),(x',D'))\in\coprod F(D)\times\coprod F(D)\ |\ (\exists f:D\rightarrow D')(F(f)(x)=x')\right\}.$$
Write $L:=\coprod F(D)/\!\sim$. Note that for $D\in\mathcal{D}$, $\pi\circ c_D:F(D)\rightarrow L$. Set $s_D:=\pi\circ c_D$ for $D\in\mathcal{D}$. Then $(L,(s_D)_{D\in\mathcal{D}})$ is a cocone on $F$.
Let $(M,(t_D)_{D\in\mathcal{D}})$ be another cocone over $F$. We have to find a unique mapping $t:L\rightarrow M$ such that $t_D=t\circ s_D$ for $D\in\mathcal{D}$. First of all, there exists a unique mapping $u:\coprod F(D)\rightarrow M$ such that $t_D=u\circ c_D$ for $D\in\mathcal{D}$. Now if we can show that $(x,D)\sim(x',D')\implies u(x,D)=u(x',D')$, then we'll get our $t$: i.e. $t$ will be $\bar{u}$.
Let $D,D'\in\mathcal{D}$ and $x\in F(D)$, $x'\in F(D')$. Suppose $(x,D)\sim(x',D')$. Well, what then? How can I use $((x,D),(x',D'))\in\bigcap_{G\in\mathcal{G}}G$ to show that $u(x,D)=u(x',D')$?
A clarification might be appreciated (although maybe you don't need it). What you're proving is that $(L,\{s_D\})$ is the colimit of the whole $F$ (so also considering the behaviour of $F$ over the arrows of $\mathcal{D}$), not just the colimit of the family $\{FD\}$ of the values that $F$ assumes over the objects, which is $X:=\bigsqcup FD$. Indeed, you might observe that the family $\{s_D\}$ commutes with the image through $F$ of any arrow of $\mathcal{D}$, and that means, as you wrote, it constitutes a cocone over the whole $F$, not just over the family $\{FD\}$.
In particular, when you are trying to obtain the arrow $L \xrightarrow{t} M$, you need to assume (as you indeed wrote) that $M$, together with the family $\{t_D\}$, is again a cocone over the whole $F$, that is, the family $\{t_D\}$ commutes with the image through $F$ of any arrow of $\mathcal{D}$. In fact, observe that, if you only assumed $(M,\{t_D\})$ to be a cocone over $\{FD\}$ and you tried to obtain $t$ with this hypothesis only, then you would be trying to prove that $L$ is the colimit of $\{FD\}$, which is $X$. Hence you would get $L$ and $X$ to be isomorphic through $\pi$, which is false in general.
Having said that and assuming $(M,\{t_D\})$ to be a cocone over $F$, how do we get $t$? As you observed, as $(M,\{t_D\})$ is in particular a cocone over the family $\{FD\}$, we get unique a map $X\xrightarrow{u} M$ such that $u \circ c_D =t_D$ for every object $D$ of $\mathcal{D}$. Now, as you said, we are done if we verify that the map $X\xrightarrow{u} M$ behaves well with the relation $\sim$ over $X$. Let us assume that, for some $(x,D),(x',D') \in X$ it is the case that $(x,D) \sim (x',D')$. As $\sim$ is by definition the smallest equivalence relation over $X$ containing $R$, there are $(x_1,D_1),(x_2,D_2),..., (x_n,D_n) \in X$ together with a finite sequence of arrows: $$D \xrightarrow{f_1} D_1 \xleftarrow{f_2}D_2\xrightarrow{f_3}D_3\xleftarrow{f_4}...\xrightarrow{f_{n-1}} D_{n-1}\xleftarrow{f_n}D_n \xrightarrow{f_{n+1}}D'$$ of $\mathcal{D}$ whose images through $F$ sequentially relate the elements $x,x_1,x_2,...,x_n,x'$. Now, observe that: $$u(x,D)=(u \circ c_D)(x)=t_D(x)\stackrel{\alpha}{=}(t_{D_1}\circ Ff_1)(x)=t_{D_1}(x_1)=(u \circ c_{D_1})(x_1)=u(x_1,D_1),$$ where $\alpha$ is precisely the hypothesis that $(M,\{t_D\})$ is a cocone over $F$. By the same argument, we get that $u(x_1,D_1)=u(x_2,D_2)$, $u(x_2,D_2)=u(x_3,D_3)$, ..., $u(x_{n-1},D_{n-1})=u(x_n,D_n)$ and $u(x_n,D_n)=u(x',D')$ as well, allowing us to conclude that $u(x,D)=u(x',D')$.