How can I label the columns and rows of a matrix?

There is another solution using the pin-it package. Please check out my reply How to input an excess matrix, where elements "overflow" the parentheses? - #7 by Fe_Y.