If I use a magnet to levitate another magnet, where is the energy coming from? Imagine I use one static magnet to levitate another magnet indefinitely.
This levitating magnet is in a narrow tube that wont allow it to rotate and get attracted. So it will keep levitating forever, right?
Since gravity uses energy to push us down to earth, and this magnet is counteracting gravity, where is this energy to counteract gravity come from?
 A: 
Since gravity uses energy to push us down to earth

This is incorrect. Gravity does not use energy to pull in us.
If we started falling, then yes, gravity used energy do make us move. But that is only in the special case where gravity makes us move. In general, gravity spends no energy pulling in us.
In general, a force spends no energy. An apple lying on a table is both pulled down by gravity and held up by the table's normal force. Gravity spends no energy here. The normal force doesn't spend any energy either. This situation of apple-lying-still-on-table will stay like that forever. It will never change, since no energy can "run out" when no energy is spent.
The levitating magnet is the same case. No energy spent. Thus, this will theoretically remain forever. (Unless there are other forces acting as well, that do spend energy.)
A: The magnet's energy comes from magnetic dipole moment. 
The real cause of magnetic dipole moment is the magnetic dipole moment of electrons in the magnet, and that is a multiple of spin because spin has deep reasons to do with the structure of angular momentum.
Gravity does not pull the magnet down. Stress-energy bends spacetime, and the magnet is following a geodesic towards the center of mass.
So the top magnet is in freefall on a geodesic towards the center of mass, and the other bottom magnet on the ground is repelling it and the top magnet levitates.
The two magnet's are exchanging virtual photons and those are excitations of the magnetic field. The EM force is what keeps the top magnet levitating. 
So the top magnet is following a geodesic in freefall through bent spacetime and the magnetic fields of the bottom and top magnet repel each other.
So the two forces are the two magnetic fields' forces that repel.
The net of these two forces would in free space be the same levitation.
In this case both magnets are in free fall on a geodesic towards the center of mass.
The bottom magnet is levitated by the surface of Earth (because the atomic and molecular structure and the repulsive EM force of the EM fields between atoms of the surface and the bottom magnet).
The top magnet is levitated by the repulsive force between the two magnet's magnetic fields' force.
The EM repulsion between the bottom magnet and the Earth's surface is so that the distance between them becomes hardly visible.
The EM repulsion between the top and bottom magnet is so that the distance between them is visible.
So where does the energy come from that levitates the bottom magnet on the surface of Earth? It is the Pauli exclusion principle, Heisenberg uncertainty principle, and the EM repulsion between the atoms in the bottom magnet and the surface of Earth.
It comes from the electron's energy, where does that come from? Electrons around the nuclei are in vacuum, and are in certain energy levels around the nuclei as per QM. They are on the certain energy levels because those levels are stable, and the electron is moving in vacuum and does not need extra energy to do so. In vacuum, the electron keeps its momentum. It does not need extra energy. Just like any object in vacuum would keep its momentum.
The top and bottom magnet's fields' forces energy comes from the electron's energy too. The electron's in the magnets keep exchanging virtual photons. The electron's do not need extra energy to do so because the net energy of both magnets together is the same.
