I'm not 100% sure I follow. If you used your Gmail account as your recovery email for Yahoo, you should be able to go to Yahoo and they will send you the information needed to recover your login info to the Gmail address. https://login.yahoo.com/account/challenge/username?
If you've forgotten both your Yahoo account login info and your Gmail account login too, you might have a more of problem. You will have to go through the Gmail recovery process as well: https://accounts.google.com/signin/recovery