Foster struck late against the 10-man Shaymen, who had led courtesy of a first half goal on the Jakemans Community Stadium 3G.
The result left the Pilgrims sixth in the Academy Division North, with 21 points to their credit from 14 matches played.
Boston (3-4-2-1): Oliver Ford; Bailey Dilley, Owen Sheriff, Jake Henderson; Taylor Jaine, Han Stevens, Mackenzie Burdass, Zane Millar; Finlay Armond, Ben Johnson; Elliot Foster. Subs (used): Sam Harris, Krisztian Gagyi; (unused): Joe Melson.
Referee: Ian Ruddock.