How to use separate power source for raspberry pi + Arduino and motors as shown in the image below
It is possible to do as you want.
Some points:

Do not use 9V battery to drive your motor! It doesn't provide enough current for motor (unless you driving very small motor).
To communicate between Raspberry and Arduino you may use any:


USB,
SPI
I2C
UART


Add a capacitor close to Arduino board, ideally 2 of caps. One of large capacity (provides some energy delivery when there is a dip in voltage due to motor draw) and another aound 100nF to protect from spikes.

Ideally you power Raspberry and Arduino from this 5V power bank and L298/motor from one of this RC models battery.