Using MQ-2 Gas Sensor with MKR1010

The 5V comes from the USB connection, so yes.