Yes, this was one of the many ways that ships could try to increase their speed while being chased. It's a very simple principle that if something is lighter it will generally travel faster and it was indeed the case with ships in the early 18th century.
The pirate historian Benerson Little writes:
To lighten ship, a crew threw as much overboard as possible: boats, spare yards and masts, guns, anchors. They might cut up cables, beams, decks, and gunwales above the ports, and heave this hemp and timber overboard, and cut loose any boat towed astern. Part of the cargo could go, and the crew could stave casks of water in the hold and pump the water out. (Little, 126-27)
From the above passage you can see that in addition to throwing cargo overboard, if they were really desperate they might even go so far as taking apart non-essential pieces of the ship from the inside and throwing those overboard as timber. However, one of the most effective and probably most common things to throw overboard in a chase would have been the cannons since they could weigh several thousand pounds on average, making them extremely heavy for their size. That's the weight of a small car. Imagine trying to gain speed with a bunch of those onboard. Of course, the obvious problem with throwing cannons away is that they can't then be used to defend the ship, but an executive decision would have to be made. If they knew they were outgunned anyway, it probably wouldn't matter, and the crews of most ships preferred to flee than fight.
Just to give a few examples of this, here are a few excerpts from a 1797 catalog of news and other material that includes many accounts of ships being captured (a bit after the so-called "golden age of piracy" but the same tactic applies):
This gazette contains an account of the capture of the Adolphe French lugger privateer, pierced for 12 guns, part of which she threw overboard, and 8 swivels, with 35 men, after being chased 4 hours, by his majesty's sloops ... (p. 100)
The Zoee, a French privateer ship, copper-bottomed, mounting 20 guns, four of which she had thrown overboard in chase, and 120 men, was taken on the 11th ... (p. 107)
French privateer lugger, of 14 three-pounders, eight of which were thrown overboard in the chase, six swivels, and 63 men ... (p. 143)
The other, L'Intrepide, a French corvette brig, fitted out from Nantes as a privateer, pierced for eighteen guns, carried 12 six-pounders, 2 eighteen pounder carronades, and one long brass twelve-pounder. She threw all of them overboard during the chase, except the brass gun, and 1 six-pounder, which she kept as stern chasers, and fired without effect until the Latona got nearly alongside her. (p. 180)
In the last example you can see that the French ship threw almost all of its fifteen guns overboard during the chase except for two that they kept as a "stern chasers," which means they fired at the pursuing British ship from the rear of the vessel. It's also interesting that the brass or bronze cannon wasn't thrown overboard since those were generally the most expensive and considered to be better than cheaper and heavier iron cannons. Another thing that isn't mentioned in any of these descriptions but that clearly did happen is that other things were thrown out of the ship besides cannons during the chase, but it isn't mentioned here simply because it didn't drastically effect the value of the ship the way cannons did.
Another reason ships in this era would throw things overboard, including cargo, other than an attempt to lighten the ship, was that merchant ships were often overladen with crates of cargo and such (sometimes including live animals and cages) stacked all over the decks and between the guns below decks, which would prevent the guns from being fired and obstruct attempts to defend the ship from being boarded. If a ship was actually prepared to put up a fight to defend itself, it would need to clear the decks of things like this and that meant throwing them overboard if there wasn't space. It could sometimes take over an hour to do this on large ships. Benerson Little writes:
Given that it might take an hour or two for a heavily laden merchantman to make a clear ship for engaging, even having to toss "lumber" (goods, supplies, or anything else stowed between the guns or on the decks) overboard, this was a viable option [boarding quickly before the ship had time to do this] (Little, 155)
I'll also add that lightening ships in this way by throwing cannons and such overboard was also a very common tactic during storms or if a ship ran aground or was sinking. An overladen ship, in addition to being slower, would also be in much more danger of capsizing and sinking in general.
If you want a really great and detailed account of all the things ships could do to evade their pursuers in a chase during the golden age of piracy in addition to chucking stuff overboard, I'd highly recommend Benerson Little's book The Sea Rover's Practice: Pirate Tactics and Techniques, 1630-1730 which has an entire chapter dedicated to this and several more about almost every other aspect of naval engagement in this period. Sailing and maneuvering ships back then was an extremely complex and complicated process which is why sailors had to be very skilled.
Sources:
The Sea Rover's Practice: Pirate Tactics and Techniques, 1630-1730 by Benerson Little