Powering MEGA from external 5V regulated source

Hello everybody !
this is my first topic here and i need help
i'm using a L298N module H-bridge driver which has an in-built logic 5V ( the multimeter reading is 5.00V)
now can i feed the MEGA 2560 with this voltage and to which pin i have to connect ? 5V or Vin ?
and is it safe ?
thanks !

5V.
Add a diode from 5V (anode) to Vin (cathode) to avoid reverse driving the 5V regulator and damaging it.

Or, you can feed 5V into the USB connector without a diode.

CrossRoads:
5V.
Add a diode from 5V (anode) to Vin (cathode) to avoid reverse driving the 5V regulator and damaging it.

Or, you can feed 5V into the USB connector without a diode.

the anode to the source 5V correct ?
and why do i need this diode ?
i mean i have a switch which would give power to all things at the same time
do i still need a diode ?
thanks

"the anode to the source 5V correct ? " Yes.

"and why do i need this diode ? "
"to avoid reverse driving the 5V regulator and damaging it."

"do i still need a diode ? "
Do you want to avoid damaging your 5V regulator so you can use the board elsewhere in the future?