Canada, bronze medallists at the past two Games, were made to work hard by Costa Rica but Jordyn Huitema scored the only goal 18 minutes from time.
World champions USA found life much more comfortable against neighbours Mexico with Sam Mewis finding the net twice in a 4-0 victory.
Canada through to fourth consecutive Games
The 36-year-old netted three times in the group stages with Huitema on six including a five-goal haul in the 9-0 win over Jamaica.
They were strong favourites against a Costa Rica side which had finished second in Group A after being thumped 6-0 by USA in their final pool game.
But despite dominating possession, Canada failed to carve out clear-cut chances and the game remained goalless midway through the second half.
Then it was Huitema who opened the scoring in the 72nd minute in fortunate fashion.
Deanne Rose's low centre across Costa Rica goalkeeper Noelia Bermudez gave the striker an open goal but somehow she hit the post before gratefully tapping home the rebound.
That goal proved enough with Canada booking their place at a fourth consecutive Olympic Games in Tokyo.
Afterwards, a relieved Sinclair told Canada Soccer: "Costa Rica made it difficult for us, they frustrated us. I thought we dominated the whole game but just couldn't find that goal. Then we got our chance and we buried it.
"I'm just proud of our team that we're heading back to the Olympics." - Canada captain Christine Sinclair
"We have lofty goals for this summer. We've been flying this qualifier, but when it always comes to this type of game - you win or you go home - it's hard. And with it comes nerves and stress. I thought we handled that pretty well. But it's definitely nice to win."
USA cruise ahead of Tokyo redemption bid
USA stamped their authority on their semi-final against Mexico right from the outset.
They took the lead in the fifth minute with Rose Lavelle, one of the stars of their World Cup victory in France last year, finding the net with a superb long-range strike which gave Mexico goalie Emily Alvarado no chance.
Mexico held out until midway through the second half when Mewis crashed a free-kick through the defensive wall and into the net.
And just over 15 minutes from time, Christen Press made it four with a chip after her initial shot had been blocked to score for the sixth game in succession for the national team.
Mission accomplished for Vlatko Andonovski's side who face Canada in Sunday's final with North American bragging rights at stake.
There was more reason to celebrate with Crystal Dunn earning her 100th cap on the USWNT.
After Sunday's clash, the USA can focus on making amends for Rio 2016.
The USA then took the next three titles, capped by a 2-1 victory over Japan in the London 2012 final.
But after arriving in Brazil as hot favourites to claim a fourth successive crown, the USA went out on penalties to Sweden in the quarter-finals.
Star goalkeeper Hope Solo called Sweden "cowards" for their tactics and was suspended by U.S. Soccer for six months before criticizing head coach Jill Ellis.
Ellis went on to guide the United States to a successful defence of their world title in France before stepping down to be replaced by Andonovski.
And with the likes of Rapinoe, Lavelle and captain Carli Lloyd still in the fold, they will be fancied to regain their Olympic crown in Tokyo.
The state of qualification for women's football at the Tokyo 2020 Olympics
Canada and USA are the seventh and eighth teams to qualify for the women's Olympic football tournament at Tokyo 2020.
Hosts Japan were joined first by 2018 Copa America winners Brazil and OFC Nations Cup victors New Zealand.
The three European places were decided at last year's World Cup with beaten finalists the Netherlands, third-placed Sweden and Great Britain, thanks to England's fourth place, making the cut.
There are four more spots up for grabs with two teams coming from Asia's AFC qualifying tournament, and one from Africa's CAF qualifiers, in March.
The runners-up from the CAF qualifiers will then meet Copa America runners-up Chile in a two-leg playoff to decide who takes the last spot in Tokyo.