Headed goals from Kelly Clark and Claire Emslie gave Pedro Martinez Losa's side a deserved half-time lead.
But Castellanos caught out Scotland goalkeeper Jenna Fife with a lob all the way from near the halfway line.
Match Stats: (Scotland - Venezuela)
77% - 23%
15 - 4
Shots on Target:
6 - 1
7 - 5