This is my first question on this site, and I'm also still a newbie with LaTeX and its plethora of packages.
I'm trying to recreate this table: 
I found this old post and tried to recreate it with the \rotatebox method, but the result ignores the forced line break in the first column, and also ignores the centering of the second column.
Here's the code I used (I'm working in Overleaf if that's important):
\documentclass{article}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{multirow}
\begin{document}
{
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{table}[h!]
\centering
\caption{Confusion matrix and performance metrics calculated from the combinations of true and predicted conditions}\label{tab:tableConfMatrix2}
\begin{tabularx}{\textwidth}{|Y|Y|Y|Y|Y|}
\hline
\multicolumn{2}{|c|}{} & \multicolumn{2}{c|}{\textbf{Prediction/ classification}} & \\
\cline{3-4}
\multicolumn{2}{|c|}{} & positive & negative & \\
\hline
\multirow[c]{2}{=}{\rotatebox[origin=c]{90}{\textbf{True condition /\newline gold standard}}} & \rotatebox[origin=c]{90}{positive} & True positive, TP & False negative, FN & Sensitivity\newline= TP / (TP + FN)\\
\cline{2-5}
& \rotatebox[origin=c]{90}{negative} & False positive, FP & True negative, TN & Specificity\newline= TN / (TN + FP)\\
\hline
\multicolumn{2}{|c|}{} & Positive predictive value\newline= TP / (TP + FP) & Negative predictive value\newline= TN / (TN + FN) & \\
\hline
\end{tabularx}
\end{table}
}
\end{document}
I also tried the \begin{sideways} command from the rotating package with exactly the same result. Now I'm out of ideas.

