comparing 2 files with awk

Hi,
I'm a new user in awk and i'm trying to compare two files to create a third one if some values match in both files.

The first file has this content:

s 45.960746365 _21_ AGT 2490 [21:0 22:0
s 45.980418496 _21_ AGT 2491 [21:0 22:0
s 46.000090627 _21_ AGT 2492 [21:0 22:0
s 47.906552206 _21_ AGT 2582 [21:0 22:0
s 50.886889357 _21_ AGT 2770 [21:0 22:0
s 50.906561488 _21_ AGT 2773 [21:0 22:0
s 50.926233619 _21_ AGT 2775 [21:0 22:0

in the second file i've got:

r 47.799403189 _22_ AGT 2492 [21:0 22:0
r 47.910640871 _22_ AGT 2582 [21:0 22:0
r 50.890877812 _22_ AGT 2770 [21:0 22:0
r 50.910929939 _22_ AGT 2773 [21:0 22:0
r 50.930582066 _22_ AGT 2775 [21:0 22:0
r 50.950014193 _22_ AGT 2777 [21:0 22:0

if $5 in both files are the same i want to print $2 of the first file and $2 of the second file.

For example, the values of $5 match in the first line of the second file and the third line of the first file. So i need a third file with the exit like this:

46.000090627, 47.799403189

Could you please help me to deal with this?

Thanks,
Carlos.

Try...

awk 'NR==FNR{a[$5]=$2;next}a[$5]{print a[$5] ", " $2}' file1 file2 > file3

It works!

Thanks Ygor.