The only definitive way is to verify if it is a 351M or 400 is to pull the pan and check the crank.
Ford Visual Identification
400 & 351M crankshaft
Crankshafts
http://home.earthlink.net/~bubbaf250/parts/parts02.html
Many people would like to know of an easy way to tell the difference between a 351M and a 400. Since the crankshaft is the main component that determines whether the engine is a 351M or a 400, the only reliable way to identify an M-block engine as either a 351M or a 400 is to verify the crankshaft casting ID code. This requires, at a minimum, removing the oil pan to view the crankshaft where the casting ID code appears.
Ford used the same components (engine blocks, cylinder heads, manifolds, etc.) to make both 351M and 400 engines. Therefore, you cannot rely on the casting ID codes or part numbers of any external component to distinguish a 351M from a 400.
Any 400 manufactured in any year can be rebuilt as a 351M by simply substituting the 351M crankshaft and pistons for the 400 parts.
Engine ID tags and calibration stickers are easily swapped from one engine to another, and even if they are not swapped, there is no way to tell whether an engine was rebuilt with 351M components without looking at the crankshaft.
M-block crankshaft casting ID codes are located on either the first counterweight (opposite the first throw at the front of the engine), or on the side of the first throw. Casting ID codes are recessed into the unfinished (raw cast) surface. Sometimes the characters are faint, so you may have to thoroughly clean the area with a solvent to find the ID code.
All 351M and 400 crankshafts are interchangeable, as long as you use the corresponding pistons. You can use any 351M or 400 crankshaft in any M-block engine block. Main bearings are different for '77-up truck blocks (D7TE) and '78-up car blocks (D8AE).
Other indicators can be the VIN if the engine is original and still in the vehicle. H=351, S=400.
Engine Codes
http://www.clubfte.com/users/mil1ion/FordTruckCodes.html
...or
Measuring the Stroke with a Rod
As long as the engine is upright and you can keep the rod close to a 45 degree angle during piston travel (not like the 2nd illustration) this method is fairly reliable.