You definitely do not want to play with the side of your fifth finger, on either hand. It is better to play with the pads and/or the tips of your fingers when possible.
The flatter your hands become, the less leverage you have from the big knuckles (the joints between the metacarpals and the first phalanges) and therefore the less control and authority you have with playing. Also when your wrist falls as your fingers flatten you have less arm weight available to use. When you have less arm weight available you have to compensate with tension from the flexor digitalis muscles and that will both slow you down and increase your risk of injury.
Resist the desire to flatten. Keep an empty space under your hand. Find a teacher to give you at least one or two lesson, over Zoom if you have no other options.
One last note: the use of the phrase "hit the piano keys" concerns me because the technique is never about hitting or striking the keys. We play the keys and we press the keys. The finger should always be touching the key before we play it, and you can't hit or strike something you're already touching. When you see a famous pianist lifting their hand high in the air before playing a loud note, that is specifcally done for visual effect and if you could watch in super slow motion you'd see they bring their hand down until they touch the key and there's the most minuscule pause and then they play the key the exact same way they would if their hand had never left the keyboard. Do not hit or strike keys. Touch them to prepare and then play them.