Chirag, FIFO is applicable on demat account basis. So, you need to pay capital gains in this case.
For transferred shares, the FIFO logic is slightly tricky.