How can i create a alpha masked rim light?

Hello! im new to unreal and its shader nodes, im trying to make a rim light with a matcap mask ive made, here is the look i am trying to get recreated in blender


Ive been messing around with fresnel but could never get that same effect as in blender. The closes ive got to recreating it is by doing this

but the mask distorts weirdly around geometry.
Could somebody please help me out and tell me what im missing or if there is a better way?