I would connect the L298N Vs pin and the Arduino Vin pin to the 12V power supply.
And connect the Vss pin of the L298N to the 5V pin of the Arduino.
This means that:
- the power supply for both is given by the 12V source.
- the logical 5V power supply for the L298N is given by the Arduino.
This is how I
connected a similar circuit, L293N.