The way cell phone triangulation works is basically just intersection of spheres. The only thing that cell towers can measure is distance between the device and the tower, and the possible locations that are formed here by a single tower forms a sphere (except if the tower uses directional antennas, which can reduce the number of towers needed to pinpoint the device location).
In three dimensional space, when two spheres intersect, you get a circle. With three spheres you get two points. And with four spheres, you isolate the locations to just one.
The minimum number of cell towers to triangulate to a single point is usually three, because the earth surface will be the fourth sphere and the other point is usually impossibly deep under the earth surface or out in the outer space, so they can be easily ruled out. However, with four towers, you don't need to rely on the earth surface and can pinpoint any single point in a three dimensional space, including height. Any more towers connected beyond three or four are redundant, but they can be used to further increase accuracy in case some of the towers have poor accuracy.
The accuracy of said triangulation though, is another matter, because cell towers aren't specifically designed for triangulation like GPS, these are just emergent functionality that happened to be possible due to the way cell towers work. The accuracy is highly dependent on the accuracy of measuring devices, the weather, whatever obstructions exists, the density of towers, whether the tower uses directional antennas, etc. In densely populated urban areas, there are higher density of cell towers which also can increase accuracy.
According to this, the accuracy of cell tower triangulation is usually about 500m-1km. So if we take that face value, cell tower triangulation can probably figure out if you're likely near the top or ground floor of a skyscraper like the Burj Khalifa which stands at 828m, but not really pinpoint the exact floors you're in. Since most buildings aren't as tall as Burj Khalifa, this doesn't even look practical in most places. Except if the skyscraper actually have a cell tower at both the top and ground level of the building itself, in which case, then maybe.
Much more practical though, to detect your height in a building, is Wifi location. Wifi has such a small radius that being able to see an access point at all is a good indication that you're either on the same floor or at most one or two levels around the access point. Having good signal from a Wifi access point is a very good indicator that you're on the same floor.