TORONTO -- Terry Dunfield scored in stoppage time to give Toronto FC a 3-2 win over Vancouver in a wild MLS game Wednesday night that seemed destined for a tie after the home side had gifted a goal to the Whitecaps on a last-minute mistake.

With the regulation 90 minutes gone, Toronto goalie Milos Kocic tried to punch away a high cross with one hand and missed it, leaving Darren Mattocks a clear header that sent the ball looping into the goal.

That made it 2-2 but Toronto wasn't finished. Dunfield, a former Whitecaps player, rose and headed in the winning goal off a corner with just seconds left.

Until then, it seemed like goals by Torsten Frings and rookie Luis Silva three minutes apart in the second half had given Toronto FC a 2-1 win.

Frings' go-ahead goal came in the 72nd minute after goalie Joe Cannon hit the turf in the wake of punching away an Eric Avila cross. The ball came to Frings and the former German international hammered home a right-footed shot from outside the penalty box with the goalie out of position.

Frings had come close seconds earlier, forcing a diving save from Cannon off a free kick. Silva had earned the kick after being scythed down by Alain Rochat.

Silva, who was influential all game, made it 1-1 in the 69th minute with his first MLS goal. And it was a thing of a beauty as he stuck out a foot to deflect in an Ashtone Morgan cross.

Fullback Lee Young-Pyo had a glorious chance to tie the game in the 85th minute but his shot rattled the right post.

Vancouver (8-5-6) had opened the scoring in the 50th minute after midfielder Barry Robson carved open the Toronto defence with a through ball to Mattocks, who seemed to have butchered the chance when his scuffed shot was stopped by Milos Kocic as a nearby defender went flying. But the ball bounced back to the rookie striker and Mattocks moved towards the byline, slotting the ball into the empty net from a tight angle.

It was the fifth goal in nine games this season for the elusive Jamaican, taken second overall in the 2012 SuperDraft.

The goal was a bitter pill for Toronto (3-11-4), which had taken the game by the scruff of its neck late in the first half and come close to scoring. The second-half comeback was a welcome tonic, especially on the heels of a poor performance in a 3-0 loss to Philadelphia on Sunday.

The game's result, before 19,824 on a warm night, continued the Whitecaps' losing run at BMO Field.

Last season, Vancouver celebrated its MLS debut with a 4-2 win over visiting Toronto but later lost 1-0 at BMO Field on a goal by Nick Soolsma, a Dutch forward who was released earlier Wednesday.

The Whitecaps had more bad memories of Toronto this season after losing the second leg of the Amway Canadian Championship 1-0 in an ill-tempered game that saw players from both sides sent off.

But Vancouver, on the fourth leg of a five-game road trip, came into the game with a 20-point bulge over Toronto in the standings.

The first half started slowly with neither team showing much finesse in the final third of the pitch. Fans behind or to the side of the goal seemed in more danger from shots than either 'keeper.

Vancouver did not manage a shot on target in the first half although Brazilian Camilo had a couple of chances, sending a header from a corner over the bar and later driving a ball across the goal.

But as the first half wore down, Silva began to make his presence felt and the home side came close.

A long Silva pass to Ryan Johnson in the 41st minute bounced off defender Martin Bonjour and found the Jamaican international with a clear path on goal. But Cannon came out and made the save with his body.

Seconds later, Cannon was up to the challenge again, this time palming away a Julian de Guzman shot.

Johnson, found behind the defence again via a beautifully flighted Silva pass, seemed destined to score in stoppage time but -- with Cannon beaten -- his shot bounced off the right post.

For the hard-working Johnson, who has played every minute this season but only has three goals, it was yet another instance where he deserved better.

Toronto fullback Jeremy Hall exited in the 28th minute in what appeared to be an injury-related substitution.

NOTES -- With Nick Soolsma's release, Joao Plata's loan deal and Reggie Lambe back in Bermuda on a personal matter, Toronto dressed just six substitutes ... After fielding the same team for three straight games, Paul Mariner brought in Julian de Guzman and Luis Silva for Eric Avila and Lambe. Whitecaps coach Martin Rennie introduced Camilo and Darren Mattocks for the departed Davide Chiumiento and suspended Eric Hassli.