Unless explicitly noted, poker hands are only 5 cards. If you have 7 cards to choose from, you make the best 5 card hand you can, and the other 2 don't count. Your best possible hand in that situation was 6 7 8 9 T. Your friend's best possible hand was 6 7 8 9 T.