Nigeria, the last team to qualify for the 12-team tournament, held Tunisia to 15 points in the first half and held a 16-point halftime lead. They led by as many as 19 and seemed in control of the game.
Tunisia, however, began the second half with a 10-2 run and closed the gap to two points late in the game.
But Aminu, who plays for the NBA's New Orleans Hornets, made of one of two free throws to seal the victory with 11 seconds remaining.
Amine Rzig scored 15 of his 18 points in the second-half to lead Tunisia in the Group A game that was the Olympic debut for both teams in men's basketball.
A dunk by Makram Ben Romdhane, a jumper by Mehdi Hafsi, a fast break by Rzig and a 3-pointer by Marouan Kechrid made it a five-point game in the fourth quarter.
When Rzig sank another 3-pointer with 4:20 left, Nigeria led by only two.
Tunisia, the African champion, came within two again with 51 seconds left on a 3-pointer by Mourad El Mabrouk.
Derrick Obasohan made two free throws then for Nigeria before a lay-up by Ben Romdhane brought Tunisia again within two.
But Obasohan then made one of two free throws, Tunisia could not score and Aminu sealed the match with another free throw.
Ike Diougu had 13 points and 10 rebounds for Nigeria.
Ben Romdhane also had a double-double, finishing with 12 points and 12 rebounds. Kechrid added 12 points for Tunisia.Suggest a correction