No, unless there is a perceivable effect
The rule on targets for spellcasting says:
Unless a spell has a perceptible effect, a creature might not know it was targeted by a spell at all. An effect like crackling lightning is obvious, but a more subtle effect, such as an attempt to read a creature's thoughts, typically goes unnoticed, unless a spell says otherwise.
What precisely has a perceivable effect is up to the DM. Something like the Mind Sliver cantrip that is intended to do damage could very well be considered to have a perceivable effect depending on how it is narrated.
There is not an official way to determine NPC reactions
But it is helpful to recognize the difference between an "attack" as the game term and an attack in regular English. The game term is restricted to things with attack rolls and a few exceptions (grappling, shoving).
The common English usage of attack, however, is not restricted to that which requires an attack roll. Anything that someone perceives as being intended to harm could be considered an attack in the mundane sense. If someone knows another person attempted to paralyze them with magic, the would-be victim might reasonably be a bit peeved.