Copy&paste the mask to the emitter position property of the effect.
Draw your path with the pen tool on a layer. Set a keyframe for mask path and then copy it.
Create a null. Call it something like particlePathNull. Set a position keyframe and select it. Now paste. You'll see an X,Y path applied to the null. Adjust the timing of the keyframes by selecting the last keyframe and dragging it out to the desired length. Make the layer 3D.
The producers X Y and z values are based on the layer. The entire layer width and height is 1 so the left side is -.5 and the right side is .5. We will have to do a little math to convert the position values of the X, Y and any position adjustment you want to make in Z scale to this range. The math is simple and there are many ways do it. I'll show you 2.
Now apply the following expressions to the producers positions:
w = (width/2)/width; px = thisComp.layer("Null 1").transform.position/width; px - w
py = thisComp.layer("Null 1").transform.position; linear(py, 0, height, -.5, .5)
pz = thisComp.layer("Null 1").transform.position/width;
The position x and position y statements correct the position so that zero is in the middle and interpolate max and min height to values between -.5 and .5 so the particle producer stays on the canvas. The default for Z is zero so only simple division is required to keep the z position lined up. In the box world of AE width and depth are always equal.
Another thing you can do to put your X Y path in Z space is to parent your particlePathNull to another 3D null and then rotate the null in X or y, then un-parent the null. Your XY path is now an X,Y,Z path.
Thanks for this great answer.
It's accurate and very clear.