Well, God knows what happened to the script writers this season(if there were any). The episode's sole aim was to fool the viewers, I presume. Example, the delayed appearance of "5 years ago subtext", when the helicopter carrying Moriarty lands at Sherrinford.
Coming back to your question. From the second season it is quite clear that Moriarty is a twisted, rich and influential man. Icing on the cake, he is also interested in destroying Sherlock, just like his sister.
PROSECUTING BARRISTER: How would you describe this man – his character?
SHERLOCK: First mistake. (He raises his eyes and locks his gaze onto Jim.) James Moriarty isn’t a man at all – he’s a spider; a spider at the centre of a web – a criminal web with a thousand threads and he knows precisely how each and every single one of them dances.
(Jim almost imperceptibly nods his head as if approving of the description.
Season 2, episode 3
So Eurus asked for a meeting with him. The tapes recorded by him sent the entire govt baffling as to what had happened. Even, Sherlock took an overdose to prove that Moriarty is not alive - The Abominable Bride episode.
In my opinion, apart from recording the tapes, Moriarty provided Eurus resources(monetary as well as other) that helped her gain control inside and outside the prison. Moreover, I believe, Moriarty also provided her with valuable information on Sherlock, the context she needed.
Since Eurus could actually control the entire prison, I don't think this was the only meeting she had with Moriarty. The 5 minute meeting was basically a foundation stone that spelled the doom for Sherlock and all the people close to him.