5 − 2 = 3
5 - 2 = 3
The first one is correct. It contains the Unicode character 'MINUS SIGN' (U+2212). The second contains the Unicode character 'HYPHEN-MINUS' (U+002D) which is not suitable for representing the minus sign in mathematical typesetting.
Also, see https://i.imgur.com/ngFI3JB.png for a few examples typeset with MathJax. The first example has a proper minus sign (correct) whereas the second one contains a hyphen (incorrect). By the way, in plain HTML, the character entity reference "−" displays the minus sign, although I just use MathJax when proper mathematics typesetting is required in HTML pages.