Problem with led matrix array

This is the kind of connections you need to sink the cathode current.
Can be discrete transistors, or can use a transistor array like ULN2003/ULN2803.
Your pins 2-3-4-5-6 would drive the cathode transistors, the rest drive the anode resistors.