I can do it in
7 steps. First select three disjoint groups of four, labeling each group as ABCD, EFGH, and IJKL. At this point, there are 240 possible orderings of the five largest numbers.
The fourth step is to compare the three largest values: A, E, & I. Without loss of generality, assume A > E > I. This identifies card A as 12, and leaves 40 possible orders for the five highest cards:
AEIXY With $XY \in \{BC,BF,BJ,FB,FG,FJ,JB,JF,JK\}$
ABEXY With $XY \in \{CF,CD,CI,FC,FG,FI,IC,IF,IJ\}$
AEBXY With $XY \in \{CF,CD,CI,FC,FG,FI,IC,IF,IJ\}$
AEFXY With $XY \in \{BC,BG,BI,GB,GH,GI,IB,IG,IH\}$
ABCXY With $XY \in \{DE,ED,EF,EI\}$
Note:
We are only comparing 3 cards on step four. We could add in a fourth, picking one of the cards that came in second. We'd have to select one at random, since we don't know which stack is which. If we got lucky and picked the card from the stack with the highest, we could get ABEI for this result, reducing the number of orderings to 4. But we could also get AEIJ, which would tell us nothing more than AEI would. So, we might as well throw in a fourth card, but in the worst case, that tells us nothing.
Continuing...
The fifth comparison should be B, C, E, & I. This can return 6 possible results:
BCEI: 4 options, ABCXY (any)
BECI: 5 options ABEXY (C>I)
BEIC: 5 options ABEXY (I>C)
EBCI: 9 options AEBXY (C>I) or AEFXY (C>I)
EBIC: 9 options AEBXY (I>C) or AEFXY (B>I>C)
EIBC: 14 options AEIXY (any) or AEFXY (I>B)
Assume the worst case. Any other results would obviously be easier to solve.
So the fifth comparison yielded EIBC. This limits the possible orderings to AEIXY or AEFXY. For the sixth step, compare: B, F, I, & J. This yields eight possible results:
FIBJ: 4 options AEFXY, XY $\in$ {GH, GI, IG, IB}
FIBJ: 4 options AEFXY, XY $\in$ {GH, GI, IG, IJ}
IBFJ: 2 options: AEIXY, XY $\in$ {BC,BF}
IBJF: 2 options: AEIXY, XY $\in$ {BC,BJ}
IFBJ: 2 options: AEIXY, XY $\in$ {FG,FB}
IFJB: 2 options: AEIXY, XY $\in$ {FG,FJ}
IJBF: 2 options: AEIXY, XY $\in$ {JB,JK}
IJFB: 2 options: AEIXY, XY $\in$ {JF,JK}
For any of these options:
after step 6, we have identified cards 12, 11, & 10, and there are at most four cards vying for numbers 9 and 8. Compare those cards: the highest is 9, the next highest is 8.
Thus, we have completed the process and identified card 8 in at most
7 steps.
Note, that as a side-effect of identifying card 8, we also identified cards 12, 11, 10, & 9. There might be a more efficient option to identify card 8 without necessarily identifying the higher cards, and this may be possible in fewer steps, but I doubt it. Given the number of possible orderings, I do not believe a more efficient algorithm is possible to identify and sort the five highest-numbered cards.