How to connect a MPU-6050 to an Arduino that already has a CNC Shield V3 on top of it? I have a CNC Shield on top of an Arduino Uno (GRBL pinout) that controls 2 stepper motors through a4988 drivers and it is working like a charm.

Now I want to add an accelerometer to it. From my humble research, the MPU-6050 seems a good pick. 

If I purchase stacking headers to lift the CNC shield, can I connect the accelerometer to the unused/reserved A4 and A5 from the Arduino, but power it using CNC's Ground and 5V pins? 

I'm open to other approaches if I'm not doing it the proper way.
MPU6050 can use only I2C. Those are pins A4 and A5 on an Uno. 5V and ground are 5v and ground, no matter from which pin