Important: This doesn't give a good look if you use an alpha of less than 1 for the stroke because of the colour blending between the stroke colour and shape colour.
Make the shape 3 pixels (using the provided example from the question) smaller in each direction (up, down, left, and right), that way the stroke is where you want it. Since the stroke counts as part of the shape, you don't have to worry about the size of the shape being smaller and when you touch the stroke it still counts as touching the shape.
Although the stroke remains half inside and half outside the new shape, the stroke is on the inside of where the original shape was and gives the look of being the same size as the original shape, while the stroke looks like it's fully on the inside.
Note that to get the amount of pixels you need to shrink the shape in each dimension by, just divide the size of the desired stroke by 2.
If you're trying to "put" the stroke on the outside of the shape, instead of decreasing the shape by however many pixels, simply increase it by the same amount on every direction.
Keep in mind that this is more of a hack than solution because there is no way (that I know of at least) to move the stroke to the inside or outside of a shape.