Reference
Identifying Intervals by Using Inversions
The easiest way to identify sixths and sevenths is by inverting the interval and analyzing the resulting third or second.
For example, instead of counting the number of whole and half steps in the sixth F#-D#, you can invert the interval and analyze the resulting third. Since the third D#-F# is a minor third, the sixth F#-D# is a major sixth. See Inversion of Intervals for more information about how the intervals are transformed after inversion.
Interval E-Db is a diminished seventh since it becomes an augmented second after inversion:

