Hitting an ace on the river also gives you a better boat, so 4 outs for this hand. Edit: Oh yea, queen too. Blah. (7 outs)
FWIW, I like the play. You were doing well in the kicker-war (A7 or K7 would probably only be called pre-flop if suited, and 87 and 76 are possible contenders which you have beaten), and I know I wouldn't mind paying off the boat he made given the situation.