I don't think there would be an easy way to relate the two. In going from $A$ to $B$ we lose information about the structure of $A$ which is important in determining the inverse of $A$.
In the $2 \times 2$ case, the $B$ matrix is just the sum of the entries. This just tells us that
$$A=\begin{bmatrix}a_{11} & a_{12} \\ a_{21} & b_{11}-a_{11}-a_{12}-a_{21}\end{bmatrix}$$
so inverse of $A$, if it exists, is $$\tfrac{1}{a_{11}(b_{11}-a_{11}-a_{12}-a_{21})-a_{12}a_{21}} \begin{bmatrix} b_{11}-a_{11}-a_{12}-a_{21} & -a_{12} \\ -a_{21} & a_{11} \end{bmatrix}.$$
So there are infinitely many $A$ matrices with the same $B$ matrix, but with distinct inverses.
If e.g.
$$
A \in \left\{ \begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 1 \\
0 & 0 & 1 \\
\end{bmatrix},
\begin{bmatrix}
1 & 0 & 0 \\
0 & 0 & 1 \\
0 & 1 & 1 \\
\end{bmatrix},
\begin{bmatrix}
1 & 0 & 0 \\
0 & 0 & 2 \\
0 & 1 & 0 \\
\end{bmatrix}
\right\}
$$
then
$$
B=
\begin{bmatrix}
1 & 0 \\
0 & 3 \\
\end{bmatrix}.
$$
But the possible $A$ matrices have distinct inverses:
$$\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & -1 \\ 0 & 0 & 1 \\ \end{bmatrix},
\begin{bmatrix} 1 & 0 & 0 \\ 0 & -1 & 1 \\ 0 & 1 & 0 \\ \end{bmatrix},
\begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1/2 & 0 \\ \end{bmatrix}.$$
The third of these even has a distinct determinant.
And even the non-invertible matrices
$$
\begin{bmatrix}
1 & 0 & 0 \\
0 & 3 & 0 \\
0 & 0 & 0 \\
\end{bmatrix}, \text{ and }
\begin{bmatrix}
1 & 0 & 0 \\
0 & 2 & 0 \\
0 & 1 & 0 \\
\end{bmatrix}$$
have the same $B$ matrix.
We can't even tell if $A$ or $B$ is invertible from its counterpart:
$\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & -2 \\
0 & 0 & 1 \\
\end{bmatrix}$ is invertible and
$\begin{bmatrix}
1 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
\end{bmatrix}$ is not invertible but
$\begin{bmatrix}
1 & 0 \\
0 & 0 \\
\end{bmatrix}$
is not invertible.
$\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{bmatrix}$ is invertible and
$\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 1 & 0 \\
\end{bmatrix}$ is not invertible but
$\begin{bmatrix}
1 & 0 \\
0 & 2 \\
\end{bmatrix}$
is invertible.