I think that you need to analyse the cross correlations between the series (this show the correlation at different lags) . These statistics assume that the time series are stationary.
Obviously, an appropriate test in the case of correlated trends require careful setting of the model. A first idea to follow is to devide both series into the trend and the perturbating parts; and then perform standard correlation procedure of the trends and separately of the perturbations.
Dear Sir, I expected this question. More covenient for me but obviously not polite would be to return with a question: and what is the trend? But one can easily guess that this is the average. Thus, to be more concrete: If the sequence of observations of one of the series - say ...,x(-1),x0,x1,x2,. . . has a trend which you are detecting by some averaging procedure, e.g. by moving arithmetic mean
then I will call the differences xk - xavk , k=... -2,-1,0,1,2,3,... a pertubation process and the averages xavk a trend process. Next you can analyse the two processes for the x-coordinates and the corresponding two for the y-coordinates separately: in particular you can analyse the correlation between xavk and yavk as the core of the process of your interest, and between xk - xavk and yk - yavk as some noise processes, which should be uncorrelated.
All above has associated to me due to your formulation. My imagination worked toward tohe question - what is the role of the trend. My answer is biased by the meaning, that you are interested in seeking the dependence of the core values of y on the core values of x. If this is not he case then, please, forget my ad hoc found algorityhm.