A few years ago I did a month lab rotation in a lab. At that time I was doing my masters and I was directly supervised by the Ph.D. student (X) of that lab. He taught me all the techniques and corrected my lab report. Then I sent it to the group leader. So basically I worked closely with the Ph.D. student and also the work I did during this one month, X used them in his further test and analysis. So that year, he published the paper and acknowledged me in that article.
Now I want to apply for a Ph.D. position and I wrote to that group leader who did not reply to me. So is it ok if I ask X to write one for me? (He completed his Ph.D. that year and I think he's a postdoc somewhere). we were not connected after that lab rotation but I got no choice except to ask X or that group leader who did not reply to me yet.