In the classification of living organisms, the Sarcopterygii class forms a monophyletic group that includes tetrapods (therefore mammals, reptiles, birds and amphibians) and a few fish (lungfish and Actinistia).
Sarcopterygii are vertebrates and Osteichthyes. This means that not only do they have a spine, but also that their skeleton is of bone.
The sister group to Sarcopterygii - Actinopterygii - includes the vast majority of fish.
Note that fish do not form one monophyletic group and that the use of this term is normally incorrect in phylogenetics.
As for reptiles, their classification has been reviewed. Although this group did not include birds, a different classification system was decided on a few years ago and reptiles now form a monophyletic group.
Sarcopterygii include lungfish, Actinistia and tetrapods. © Bruno Scala, cc by nc nd 2.0