The NorCal side was the surprise winner of the CCL Group Stage's tightest group, but will have a big task against top seed Toluca.
Due to first-place Montreal's -1 goal difference, it was known coming into this game that one of the two sides would be moving on. San Jose needed a win, while Heredia would go through if it avoided a loss.
Chris Wondolowski made the breakthrough halfway through the second half. Horrendously marked, he had plenty of time to redirect a corner kick into the net with a one-timed, side-footed finish.
The result means all three Group 5 teams finish on six points, but San Jose has a +2 goal difference, ahead of Montreal and Heredia which both have -1.
San Jose will face 2012 Liga MX Apertura runner-up Toluca in the next round.