The Saudi Arabia-based forward and captain of the Indomitable Lions, connected with a cross from substitute Jerome Ngom Mbekeli to break the score deadlock in the 92nd minute at Doha's Lusail Stadium.
Cameroon, whose last win at the World Cup was in 2002 against Saudi Arabia, were on the back foot for most of the match but sprung to life at the end.
Brazil had by far the larger share of possession and carved out many more chances than their opponents. But in the end it was Cameroon who got the only statistic that actually counted.
Brazil possessed the ball 65 percent to Cameroon's 35 percent, logging seven shots on goal, Cameroon had three.
Aboubakar was booked for removing his shirt in the wild celebrations that followed and, having already been cautioned, had to leave his teammates to see out the remainder of the game.
Though Cameroon recorded the famous win, Switzerland's 3-2 win over Serbia at the same time meant the Swiss advanced from Group G along with already-qualified Brazil.
Having won their first two matches in Qatar, Brazil topped the group and advance to a last-16 tie against South Korea when their many key players who were rested for this game will return.
Brazil coach Tite sent out a second-string side and the result was Brazil's first defeat in the group stage of a World Cup since 1998, when they were beaten by Norway.
The win by Cameroon marks Brazil's first-ever defeat to an African opponent at a World Cup.
Brazil will face Group H runners-up South Korea, who beat Portugal 2-1, in the next round on December 5.
Some information for this report came from Reuters.