So you are talking about a sailing ship?
In that case, you don't need to control the entire ship, just the top deck since that is where all the control surfaces (i.e. sails and rudder) are located. So a common tactic from this era was either a night raid (creep up in a row boat, scale the sides, take out the night sentries on the top deck) or to approach under a subterfuge (appear to be a friendly vessel with a diplomatic message, supplies, or the like) and quickly overwhelm the top deck sailors/marines. Then you can trap the rest of the crew below decks by pinning/blocking the hatches and doors. Now you control the masts and sails and can control the rudder by rigging it for outside control (larger ships of this period had a steering wheel that led to a system of control gears for the rudder that was internal to the ship and could still be controlled by the sailors below decks, but it is usually a trivial task to rig the rudder with ropes so it could be crudely controlled from outside the ship).
Now this leaves the crew still in control of all the cannons and whatnot below decks. They have all the supplies, including water. So once you board and control the top deck, you need a plan for getting the ship under better control pretty quickly. A common tactic was to threaten the crew with fire, since you could set the ship ablaze and escape on the boat that you came in on.
If you must meet this stronger ship when it is alert in the daytime, you need to be able to strike first. Often a pirate ship would pretend to be a relatively lightly manned merchant ship (since the hulls were usually the same). They could lure in the enemy ship and launch a surprise attack. Getting in the first blow is critical, since the topside sailors may be out in the open and grouped together, making them more susceptible to grenades, grapeshot, and the like. Sharpshooters can also target officers, since personal initiative was fairly low around this period and folks were very likely to surrender instead of fight if not motivated by an officer. So a surprise attack that wounds a decent number of topside sailors as well as some concealed sharpshooters to hit the captain or deck officers may stun the enemy long enough for your raiding party (hidden on the top deck of your ship) to cross over and seize control.
Remember that most of a ships crew won't be ready to respond unless there is some warning of a boarding action. They will be below decks, manning cannon. So your ship may get blasted, but it is unlikely to be sunk if you can seize control of the enemy ship quickly and trap the crew below decks. So it is your entire crew versus who they have topside, which may even out the numbers quite a bit.
Another possibility is to lure the enemy ship in close and try to take out their rudder or masts. If you destroy their ability to control their ship, then you can maneuver to cross their bow or stern, there their firepower is weak and you can "rake" their entire ship with your guns. In this position most ships have no option but to strike their colors, even to a much smaller vessel, and accept a boarding party to take control of the ship (in this period there were significant "take my word for it" agreements about the laws of war). Then you lock most of the enemy crew below decks, take their officers hostage, and set your prize crew to sail their ship into a friendly port.
EDIT: I just noticed the date range you specified is a little earlier than I initially thought. Ships in that era had less effective cannons and sailing characteristics, so they were more like little floating castles than the more Napoleonic era stuff I was describing. While the tactics I describe are still valid, earlier ships were more fortified on the top with "towers" to the fore and aft, complete with arrow firing ports and protected positions. These towers were high above the water, so they could see (and fire) down into any smaller ship. So attempting to quickly seize control of these types of ships is a bit more difficult as the fore and aft castles can defend the ship. You will need to have boarding ladders or very daring sailors willing to swing or even walk across one ships masts and spars over to the enemy. Clever positioning could allow one to just trot across the spar of your mast right over to the opposing ships spar, though of course doing this while under fire and in rough seas would be challenging at best. So approaching under the guise of a friendly would be paramount.
Another consideration is that these "castle ships" are much less maneuverable than the more modern "race ships" we typically think of in the age of sail. Battles from this Era So if your faster, smaller ship can catch the opponent in an disadvantageous state, say being blown against some rocks where the smaller ship can still maneuver but the larger ship can't, the smaller ship can pummel the larger ship without fear of reprisal. Maneuverability and being able to move into the wind was a HUGE advantage in sailing naval battles, especially in single ship actions. So your daring captain, if he can't slip in close by trickery, could ambush his enemy when wind conditions and any nearby shoreline/reef will hamper the enemy while the good guy can blast away. If he can damage the rigging/masts or hole the hull a bit, the enemy ship may founder or run aground, where it will be completely at the mercy of the other ship. Thus our good captain needs to lure the enemy into an ambush. This will probably involve sending him taunting letters, planting rumors of a fat prize ship just waiting to be taken to draw the enemy out, and disguising his ship so it won't be recognized.
The battle, even with favorable conditions, won't be a done deal though, because the larger ship will pack a dangerous broadside and if they close, should be able to easily pick off people from the vantage point of their higher deck and the castles. There is quite a bit of guesswork, nerves, skill, and luck in ship 'duels' in reading the wind, the state of the other ship, the skill and moral of your own crew vs the opponent, etc. One slip that lets the enemy ship lay in with their guns could spell disaster.